openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r496912 - /incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java
Date Wed, 17 Jan 2007 01:57:07 GMT
Author: pcl
Date: Tue Jan 16 17:57:07 2007
New Revision: 496912

URL: http://svn.apache.org/viewvc?view=rev&rev=496912
Log:
Resolve jar scanning issue by avoiding certain probably-buggy ZipInputStream methods

Modified:
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java?view=diff&rev=496912&r1=496911&r2=496912
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java
(original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/ZipStreamMetaDataIterator.java
Tue Jan 16 17:57:07 2007
@@ -112,16 +112,10 @@
     public byte[] getContent() throws IOException {
         // buffer content so that future calls to getInputStream can read
         // the same data
-        int size = (int) _entry.getSize();
-        if (size < 0) {
-            ByteArrayOutputStream bout = new ByteArrayOutputStream();
-            byte[] buf = new byte[1024];
-            for (int r; (r = _stream.read(buf)) != -1; bout.write(buf, 0, r)) ;
-            _buf = bout.toByteArray();
-        } else {
-            _buf = new byte[size];
-            _stream.read(_buf);
-        }
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        byte[] buf = new byte[1024];
+        for (int r; (r = _stream.read(buf)) != -1; bout.write(buf, 0, r)) ;
+        _buf = bout.toByteArray();
         _stream.closeEntry();
         return _buf;
     }



Mime
View raw message