This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git


The following commit(s) were added to refs/heads/master by this push:
     new 8096365  Replace boolean array with AtomicBoolean.
8096365 is described below

commit 8096365a9291b0ab476d8005d66d4fc14d0af928
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Mar 15 08:56:09 2021 -0400

    Replace boolean array with AtomicBoolean.
---
 .../org/apache/commons/vfs2/provider/DefaultFileContentTest.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
index 14d646a..23bf03b 100644
--- 
a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
+++ 
b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.charset.StandardCharsets;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -185,17 +186,18 @@ public class DefaultFileContentTest {
 
         try (FileObject file = 
fileSystemManager.resolveFile(temp.getAbsolutePath())) {
             T stream = getStream.apply(file.getContent());
-            boolean[] check = { false };
+            AtomicBoolean check = new AtomicBoolean();
             Thread thread = new Thread(() -> {
                 try {
                     stream.close();
                 } catch (IOException exception) {
+                    // ignore
                 }
-                check[0] = true;
+                check.set(true);
             });
             thread.start();
             thread.join();
-            Assert.assertTrue(check[0]);
+            Assert.assertTrue(check.get());
         }
     }
 }

Reply via email to