Skip to content

Commit

Permalink
Update spotbugs 4.6.0 -> 4.7.0 (#2222)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scottmitch authored May 27, 2022
1 parent cda273e commit 83fd27c
Show file tree
Hide file tree
Showing 71 changed files with 1,331 additions and 19 deletions.
26 changes: 26 additions & 0 deletions servicetalk-buffer-api/gradle/spotbugs/test-exclusions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2022 Apple Inc. and the ServiceTalk project authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2022 Apple Inc. and the ServiceTalk project authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
</FindBugsFilter>
8 changes: 8 additions & 0 deletions servicetalk-client-api/gradle/spotbugs/test-exclusions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@
<Source name="~.*Test\.java"/>
<Bug pattern="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2022 Apple Inc. and the ServiceTalk project authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Class name="io.servicetalk.concurrent.api.internal.BlockingUtils"/>
<Or>
<Method name="blockingInvocation"/>
<Method name="futureGetCancelOnInterrupt"/>
</Or>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@
<Source name="~.*Test\.java"/>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
</Match>
<Match>
<Source name="~.*Test.*\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test.*\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test.*\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2022 Apple Inc. and the ServiceTalk project authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Class name="io.servicetalk.concurrent.api.test.InlineStepVerifier"/>
<Or>
<Method name="processRuntimeException"/>
<Method name="processVerifyEvent"/>
</Or>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2022 Apple Inc. and the ServiceTalk project authors
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FindBugsFilter>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
</FindBugsFilter>
41 changes: 41 additions & 0 deletions servicetalk-concurrent-api/gradle/spotbugs/main-exclusions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,45 @@
<Class name="io.servicetalk.concurrent.api.AsyncContext"/>
<Bug pattern="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
</Match>

<Match>
<Class name="io.servicetalk.concurrent.api.AutoCloseables"/>
<Method name="closeGracefully"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.CompositeCloseable"/>
<Method name="close"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.ContextPreservingCallable"/>
<Method name="call"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.ContextPreservingCallable"/>
<Method name="slowPath"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.Completable"/>
<Method name="lambda$fromRunnable$4"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.PublisherAsBlockingIterable$SubscriberAndIterator"/>
<Method name="processNext"/>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.ScanWithMapper"/>
<Method name="mapOnError"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.DefaultExecutor"/>
<Method name="shutdownExecutor"/>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
</FindBugsFilter>
12 changes: 12 additions & 0 deletions servicetalk-concurrent-api/gradle/spotbugs/test-exclusions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,16 @@
<Method name="synchronousCancelStillAllowsForGC"/>
<Bug pattern="DM_GC"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_THROWABLE"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@
<Field name="executor"/>
<Bug pattern="NP_NONNULL_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.api.TestIterableToBlockingIterable$TestIteratorToBlockingIterator"/>
<Method name="close"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -2712,7 +2712,7 @@ private CopyContextMap removeBelowSeven(int i) {
(Key<?>) context[8], context[9],
(Key<?>) context[10], context[11]);
default:
throw new RuntimeException("Programming error, unable to remove a key at index=" + i);
throw new IllegalStateException("Programming error, unable to remove a key at index=" + i);
}
}

Expand Down Expand Up @@ -2838,7 +2838,7 @@ private CopyContextMap removeBelowSeven(final GrowableIntArray indexesToRemove)
default:
break;
}
throw new RuntimeException("Programming error, unable to reduce from " + size() + " to " +
throw new IllegalStateException("Programming error, unable to reduce from " + size() + " to " +
(size() - indexesToRemove.count()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public CopyOnWriteSet remove(final ExecutorPlugin plugin) {
case 2:
return new TwoExecutorPluginSet(plugins[0], plugins[1]);
default:
throw new RuntimeException("programming error. i: " + i);
throw new IllegalStateException("programming error. i: " + i);
}
}
ExecutorPlugin[] newArray = new ExecutorPlugin[plugins.length - 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void testNonResubscribeableCompletable() {

source.subscribe(subscriber2);

Exception e = assertThrows(RuntimeException.class, () -> source.onComplete());
AssertionError e = assertThrows(AssertionError.class, () -> source.onComplete());
assertEquals("Unexpected exception(s) encountered", e.getMessage());
assertThat(e.getCause(), allOf(instanceOf(IllegalStateException.class),
hasProperty("message", startsWith("Duplicate subscriber"))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void testNonResubscribeablePublisher() {

source.subscribe(subscriber2);

Exception e = assertThrows(RuntimeException.class, () -> source.onComplete());
AssertionError e = assertThrows(AssertionError.class, () -> source.onComplete());
assertEquals("Unexpected exception(s) encountered", e.getMessage());
assertThat(e.getCause(), allOf(instanceOf(IllegalStateException.class),
hasProperty("message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void testNonResubscribeableSingle() {

source.subscribe(subscriber2);

Exception e = assertThrows(RuntimeException.class, () -> source.onSuccess("b"));
AssertionError e = assertThrows(AssertionError.class, () -> source.onSuccess("b"));
assertEquals("Unexpected exception(s) encountered", e.getMessage());
assertThat(e.getCause(), allOf(instanceOf(IllegalStateException.class),
hasProperty("message",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void onError(final Throwable t) {

private Subscriber checkSubscriberAndExceptions() {
if (!exceptions.isEmpty()) {
final RuntimeException exception = new RuntimeException("Unexpected exception(s) encountered",
final AssertionError exception = new AssertionError("Unexpected exception(s) encountered",
exceptions.get(0));
for (int i = 1; i < exceptions.size(); i++) {
addSuppressed(exception, exceptions.get(i));
Expand Down Expand Up @@ -353,7 +353,7 @@ private Subscriber waitForSubscriber() {
Thread.currentThread().interrupt();
return throwException(e);
} catch (ExecutionException e) {
throw new RuntimeException(e);
return throwException(e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void onError(final Throwable t) {

private Subscriber<? super T> checkSubscriberAndExceptions() {
if (!exceptions.isEmpty()) {
final RuntimeException exception = new RuntimeException("Unexpected exception(s) encountered",
final AssertionError exception = new AssertionError("Unexpected exception(s) encountered",
exceptions.get(0));
for (int i = 1; i < exceptions.size(); i++) {
addSuppressed(exception, exceptions.get(i));
Expand Down Expand Up @@ -422,7 +422,7 @@ private Subscriber<? super T> waitForSubscriber() {
Thread.currentThread().interrupt();
return throwException(e);
} catch (ExecutionException e) {
throw new RuntimeException(e);
return throwException(e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void onError(final Throwable t) {

private Subscriber<? super T> checkSubscriberAndExceptions() {
if (!exceptions.isEmpty()) {
final RuntimeException exception = new RuntimeException("Unexpected exception(s) encountered",
final AssertionError exception = new AssertionError("Unexpected exception(s) encountered",
exceptions.get(0));
for (int i = 1; i < exceptions.size(); i++) {
addSuppressed(exception, exceptions.get(i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,35 @@
<Method name="&lt;init&gt;"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.internal.AbstractCloseableIterable"/>
<Method name="closeIterator"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.internal.AbstractCloseableIterable$1"/>
<Method name="close"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.internal.AbstractCloseableIterable$1"/>
<Or>
<Method name="close"/>
<Method name="hasNext"/>
</Or>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Class name="io.servicetalk.concurrent.internal.AutoClosableUtils"/>
<Method name="closeAndReThrowUnchecked"/>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
<Match>
<Or>
<Class name="io.servicetalk.concurrent.internal.BlockingIterables$1"/>
<Class name="io.servicetalk.concurrent.internal.BlockingIterables$2"/>
</Or>
<Method name="close"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@
<Source name="~.*Test\.java"/>
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
</Match>
<Match>
<Source name="~.*Test\.java"/>
<Bug pattern="THROWS_METHOD_THROWS_CLAUSE_BASIC_EXCEPTION"/>
</Match>
</FindBugsFilter>
Loading

0 comments on commit 83fd27c

Please sign in to comment.