commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1511555 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java
Date Thu, 08 Aug 2013 01:51:42 GMT
Author: ggregory
Date: Thu Aug  8 01:51:41 2013
New Revision: 1511555

URL: http://svn.apache.org/r1511555
Log:
[VFS-483][RAM] Many suggestions to improve the RAM file provider. Refactor 'new byte[0]' into
a private static final byte[] called EMPTY.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java?rev=1511555&r1=1511554&r2=1511555&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java
Thu Aug  8 01:51:41 2013
@@ -30,6 +30,8 @@ import org.apache.commons.vfs2.FileType;
  */
 class RamFileData implements Serializable
 {
+    private static final byte[] EMPTY = new byte[0];
+
     /**
      * serialVersionUID format is YYYYMMDD for the date of the last binary change.
      */
@@ -131,7 +133,7 @@ class RamFileData implements Serializabl
      */
     void clear()
     {
-        this.content = new byte[0];
+        this.content = EMPTY;
         updateLastModified();
         this.type = FileType.IMAGINARY;
         this.children.clear();



Mime
View raw message