ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r552218 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs: Jar.java Zip.java
Date Sat, 30 Jun 2007 21:59:13 GMT
Author: jkf
Date: Sat Jun 30 14:59:12 2007
New Revision: 552218

URL: http://svn.apache.org/viewvc?view=rev&rev=552218
Log:
Reviewed Jar (and parts of Zip) because of BR 42632

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java?view=diff&rev=552218&r1=552217&r2=552218
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Jar.java Sat Jun 30 14:59:12 2007
@@ -150,10 +150,6 @@
         JarMarker.getInstance()
     };
 
-    // CheckStyle:VisibilityModifier OFF - bc
-    protected String emptyBehavior = "create";
-    // CheckStyle:VisibilityModifier ON
-
     /** constructor */
     public Jar() {
         super();
@@ -456,7 +452,7 @@
         throws IOException {
         for (Enumeration e = manifest.getWarnings();
              e.hasMoreElements();) {
-            log("Manifest warning: " + (String) e.nextElement(),
+            log("Manifest warning: " + e.nextElement(),
                 Project.MSG_WARN);
         }
 
@@ -467,7 +463,7 @@
         OutputStreamWriter osw = new OutputStreamWriter(baos, Manifest.JAR_ENCODING);
         PrintWriter writer = new PrintWriter(osw);
         manifest.write(writer);
-        writer.flush();
+        writer.close();
 
         ByteArrayInputStream bais =
             new ByteArrayInputStream(baos.toByteArray());
@@ -549,7 +545,7 @@
             }
         }
 
-        writer.flush();
+        writer.close();
         ByteArrayInputStream bais =
             new ByteArrayInputStream(baos.toByteArray());
         super.zipFile(bais, zOut, INDEX_NAME, System.currentTimeMillis(), null,

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java?view=diff&rev=552218&r1=552217&r2=552218
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Zip.java Sat Jun 30 14:59:12 2007
@@ -759,13 +759,16 @@
                         if (keepCompression) {
                             doCompress = (ze.getMethod() == ZipEntry.DEFLATED);
                         }
+                        InputStream is = null;
                         try {
-                            zipFile(zf.getInputStream(ze), zOut, prefix + name,
+                            is = zf.getInputStream(ze);
+                            zipFile(is, zOut, prefix + name,
                                     ze.getTime(), zfs.getSrc(getProject()),
                                     zfs.hasFileModeBeenSet() ? fileMode
                                     : ze.getUnixMode());
                         } finally {
                             doCompress = oldCompress;
+                            FileUtils.close(is);
                         }
                     }
                     } else {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message