commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r753387 - /commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Date Fri, 13 Mar 2009 20:30:42 GMT
Author: sebb
Date: Fri Mar 13 20:30:30 2009
New Revision: 753387

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

Modified:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=753387&r1=753386&r2=753387&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Fri Mar 13 20:30:30 2009
@@ -219,7 +219,7 @@
     /**
      * Optional random access output.
      */
-    private RandomAccessFile raf = null;
+    private final RandomAccessFile raf;
 
     private final OutputStream out;
 
@@ -245,6 +245,7 @@
      */
     public ZipArchiveOutputStream(OutputStream out) {
         this.out = out;
+        this.raf = null;
     }
 
     /**
@@ -255,21 +256,23 @@
      */
     public ZipArchiveOutputStream(File file) throws IOException {
         OutputStream o = null;
+        RandomAccessFile _raf = null;
         try {
-            raf = new RandomAccessFile(file, "rw");
-            raf.setLength(0);
+            _raf = new RandomAccessFile(file, "rw");
+            _raf.setLength(0);
         } catch (IOException e) {
-            if (raf != null) {
+            if (_raf != null) {
                 try {
-                    raf.close();
+                    _raf.close();
                 } catch (IOException inner) {
                     // ignore
                 }
-                raf = null;
+                _raf = null;
             }
             o = new FileOutputStream(file);
         }
         out = o;
+        raf = _raf;
     }
 
     /**



Mime
View raw message