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
The following commit(s) were added to refs/heads/8.5.x by this push: new 8bbab5b Fix SpotBugs warnings 8bbab5b is described below commit 8bbab5b1771ec026a596a2e0c7aabb82ab45da63 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Feb 25 15:57:30 2021 +0000 Fix SpotBugs warnings --- .../catalina/nonblocking/TestNonBlockingAPI.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java index c612c4a..cd8321e 100644 --- a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java +++ b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java @@ -1379,9 +1379,9 @@ public class TestNonBlockingAPI extends TomcatBaseTest { private static final long serialVersionUID = 1L; - private final CountDownLatch responseCommitLatch; - private final CountDownLatch clientCloseLatch; - private final CountDownLatch asyncCompleteLatch; + private final transient CountDownLatch responseCommitLatch; + private final transient CountDownLatch clientCloseLatch; + private final transient CountDownLatch asyncCompleteLatch; private final boolean swallowIoException; public NBWriteServlet02(CountDownLatch responseCommitLatch, CountDownLatch clientCloseLatch, @@ -1444,7 +1444,7 @@ public class TestNonBlockingAPI extends TomcatBaseTest { private final CountDownLatch responseCommitLatch; private final CountDownLatch clientCloseLatch; private final boolean swallowIoException; - private volatile int stage = 0; + private volatile AtomicInteger stage = new AtomicInteger(0); public TestWriteListener02(AsyncContext ac, CountDownLatch responseCommitLatch, CountDownLatch clientCloseLatch, boolean swallowIoException) { @@ -1459,12 +1459,12 @@ public class TestNonBlockingAPI extends TomcatBaseTest { try { ServletOutputStream sos = ac.getResponse().getOutputStream(); do { - if (stage == 0) { + if (stage.get() == 0) { // Commit the response ac.getResponse().flushBuffer(); responseCommitLatch.countDown(); - stage++; - } else if (stage == 1) { + stage.incrementAndGet(); + } else if (stage.get() == 1) { // Wait for the client to drop the connection try { clientCloseLatch.await(); @@ -1472,8 +1472,8 @@ public class TestNonBlockingAPI extends TomcatBaseTest { // Ignore } sos.print("TEST"); - stage++; - } else if (stage == 2) { + stage.incrementAndGet(); + } else if (stage.get() == 2) { sos.flush(); } } while (sos.isReady()); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org