commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r753366 - in /commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress: archivers/zip/ZipFile.java archivers/zip/ZipLong.java archivers/zip/ZipShort.java changes/Change.java
Date Fri, 13 Mar 2009 19:41:46 GMT
Author: sebb
Date: Fri Mar 13 19:41:42 2009
New Revision: 753366

URL: http://svn.apache.org/viewvc?rev=753366&view=rev
Log:
Make some private fields final

Modified:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/changes/Change.java

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=753366&r1=753365&r2=753366&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Fri Mar 13 19:41:42 2009
@@ -104,7 +104,7 @@
     /**
      * The actual data source.
      */
-    private RandomAccessFile archive;
+    private final RandomAccessFile archive;
 
     /**
      * Whether to look for and use Unicode extra fields.

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java?rev=753366&r1=753365&r2=753366&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
Fri Mar 13 19:41:42 2009
@@ -39,7 +39,7 @@
     private static final long BYTE_3_MASK = 0xFF000000L;
     private static final int BYTE_3_SHIFT = 24;
 
-    private long value;
+    private final long value;
 
     /**
      * Create instance from a number.

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java?rev=753366&r1=753365&r2=753366&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
Fri Mar 13 19:41:42 2009
@@ -27,7 +27,7 @@
     private static final int BYTE_1_MASK = 0xFF00;
     private static final int BYTE_1_SHIFT = 8;
 
-    private int value;
+    private final int value;
 
     /**
      * Create instance from a number.

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/changes/Change.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/changes/Change.java?rev=753366&r1=753365&r2=753366&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/changes/Change.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/changes/Change.java
Fri Mar 13 19:41:42 2009
@@ -24,14 +24,14 @@
 
 
 public class Change {
-	private String targetFile = null;
-	private ArchiveEntry entry = null;
-	private InputStream input = null;
-	private int type = 0;
+	private final String targetFile;
+	private final ArchiveEntry entry;
+	private final InputStream input;
+	private final int type;
 	
 	static final int TYPE_DELETE = 1;
 	static final int TYPE_ADD = 2;
-	static final int TYPE_MOVE = 3;
+	static final int TYPE_MOVE = 3; // NOT USED
 	
 	/**
 	 * Constructor. Takes the filename of the file to be deleted
@@ -44,6 +44,8 @@
 		}
 		targetFile = pFilename;
 		type = TYPE_DELETE;
+		input = null;
+		entry = null;
 	}
 	
 //	public Change(final String pOldname, final ArchiveEntry pEntry) {
@@ -62,6 +64,7 @@
 		this.entry = pEntry;
 		this.input = pInput;
 		type = TYPE_ADD;
+		targetFile = null;
 	}
 	
 	public ArchiveEntry getEntry() {



Mime
View raw message