You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/05/14 02:19:05 UTC
svn commit: r1482156 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Author: sebb
Date: Tue May 14 00:19:04 2013
New Revision: 1482156
URL: http://svn.apache.org/r1482156
Log:
Avoid NPE warning
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=1482156&r1=1482155&r2=1482156&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java Tue May 14 00:19:04 2013
@@ -334,10 +334,11 @@ public class ZipArchiveInputStream exten
.HEADER_ID);
current.usesZip64 = z64 != null;
if (!current.hasDataDescriptor) {
- if (current.usesZip64 && (cSize.equals(ZipLong.ZIP64_MAGIC)
+ if (z64 != null // same as current.usesZip64 but avoids NPE warning
+ && (cSize.equals(ZipLong.ZIP64_MAGIC)
|| size.equals(ZipLong.ZIP64_MAGIC))
) {
- current.entry.setCompressedSize(z64.getCompressedSize() // z64 cannot be null here
+ current.entry.setCompressedSize(z64.getCompressedSize()
.getLongValue());
current.entry.setSize(z64.getSize().getLongValue());
} else {