This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new c83ce77 Fix SpotBugs warnings
c83ce77 is described below
commit c83ce77ce58d42a4bd40d0807277ccddbdf1c97c
Author: Mark Thomas <[email protected]>
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 f6a8fec..fb63b8c 100644
--- a/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
+++ b/test/org/apache/catalina/nonblocking/TestNonBlockingAPI.java
@@ -1375,9 +1375,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,
@@ -1440,7 +1440,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) {
@@ -1455,12 +1455,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();
@@ -1468,8 +1468,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: [email protected]
For additional commands, e-mail: [email protected]