You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2013/08/08 03:51:42 UTC

svn commit: r1511555 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileData.java

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();