This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 154483315d7dab3b6949979a58c1d200d43b12b8 Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Mar 6 12:33:29 2020 +0000 Fix SpotBugs issues in unit tests --- res/findbugs/filter-false-positives.xml | 7 +++++++ .../apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java | 2 +- test/org/apache/coyote/http2/TestAsyncTimeout.java | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index b45c160..23c272a 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -1574,6 +1574,7 @@ <Or> <Method name="testAuthMethodBadMethod"/> <Method name="testBadBase64Char"/> + <Method name="testBadBase64InlineEquals"/> </Or> <Bug pattern="DLS_DEAD_LOCAL_STORE"/> </Match> @@ -1859,6 +1860,12 @@ <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/> </Match> <Match> + <!-- Latch isn't essential so no need to check return --> + <Class name="org.apache.coyote.http2.TestAsyncTimeout"/> + <Method name="testTimeout"/> + <Bug pattern="RV_RETURN_VALUE_IGNORED"/> + </Match> + <Match> <!-- Result is negated to compare result when order is reversed --> <Class name="org.apache.el.TestELEvaluation" /> <Method name="compareBoth" /> diff --git a/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java b/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java index 4f406fc..27bce41 100644 --- a/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java +++ b/test/org/apache/coyote/http11/upgrade/TestUpgradeInternalHandler.java @@ -227,7 +227,7 @@ public class TestUpgradeInternalHandler extends TomcatBaseTest { }, buffer); System.out.println("CompletionState: " + state); // Test zero length write used by websockets - state = wrapper.write(BlockingMode.BLOCK, 10, TimeUnit.SECONDS, null, SocketWrapperBase.COMPLETE_WRITE_WITH_COMPLETION, new CompletionHandler<Long, Void>() { + wrapper.write(BlockingMode.BLOCK, 10, TimeUnit.SECONDS, null, SocketWrapperBase.COMPLETE_WRITE_WITH_COMPLETION, new CompletionHandler<Long, Void>() { @Override public void completed(Long result, Void attachment) { System.out.println("Write: " + result.longValue()); diff --git a/test/org/apache/coyote/http2/TestAsyncTimeout.java b/test/org/apache/coyote/http2/TestAsyncTimeout.java index 1e97490..8560229 100644 --- a/test/org/apache/coyote/http2/TestAsyncTimeout.java +++ b/test/org/apache/coyote/http2/TestAsyncTimeout.java @@ -52,8 +52,8 @@ public class TestAsyncTimeout extends Http2TestBase { // This is the servlet that does that actual test // This latch is used to signal that that async thread used by the test - // has ended. It isn;t essential to the test but it allows the test to - // complete without Tmcat logging an error about a still running thread. + // has ended. It isn't essential to the test but it allows the test to + // complete without Tomcat logging an error about a still running thread. CountDownLatch latch = new CountDownLatch(1); Wrapper w = Tomcat.addServlet(ctxt, "async", new AsyncTimeoutServlet(latch)); w.setAsyncSupported(true); @@ -95,7 +95,7 @@ public class TestAsyncTimeout extends Http2TestBase { private static final long serialVersionUID = 1L; - private final CountDownLatch latch; + private final transient CountDownLatch latch; public AsyncTimeoutServlet(CountDownLatch latch) { this.latch = latch; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org