commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1586950 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
Date Sun, 13 Apr 2014 10:05:49 GMT
Author: sebb
Date: Sun Apr 13 10:05:48 2014
New Revision: 1586950

URL: http://svn.apache.org/r1586950
Log:
Explain why it's OK to share static mutable field - it's write-only

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java?rev=1586950&r1=1586949&r2=1586950&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/utils/IOUtils.java
Sun Apr 13 10:05:48 2014
@@ -26,12 +26,15 @@ import java.io.OutputStream;
 
 /**
  * Utility functions
- * @Immutable
+ * @Immutable (has mutable data but it is write-only)
  */
 public final class IOUtils {
 
     private static final int COPY_BUF_SIZE = 8024;
     private static final int SKIP_BUF_SIZE = 4096;
+    
+    // This buffer does not need to be synchronised because it is write only; the contents
are ignored
+    // Does not affect Immutability
     private static final byte[] SKIP_BUF = new byte[SKIP_BUF_SIZE];
 
     /** Private constructor to prevent instantiation of this utility class. */



Mime
View raw message