commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/3] commons-compress git commit: whitelist byte-arrays deliberately shared in package
Date Tue, 20 Dec 2016 13:41:40 GMT
whitelist byte-arrays deliberately shared in package


Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/5e0980f0
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/5e0980f0
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/5e0980f0

Branch: refs/heads/master
Commit: 5e0980f01a5b434aa9bccd8e584ebae681377492
Parents: 0c73ea7
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Tue Dec 20 14:41:10 2016 +0100
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Tue Dec 20 14:41:10 2016 +0100

----------------------------------------------------------------------
 .../commons/compress/archivers/sevenz/SevenZFile.java |  3 ++-
 .../archivers/zip/ZipArchiveOutputStream.java         | 14 +++++++-------
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/5e0980f0/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
index 874885e..9ad0746 100644
--- a/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
+++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java
@@ -83,7 +83,8 @@ public class SevenZFile implements Closeable {
 
     private final ArrayList<InputStream> deferredBlockStreams = new ArrayList<>();
 
-    static final byte[] sevenZSignature = {
+    // shared with SevenZOutputFile and tests, neither mutates it
+    static final byte[] sevenZSignature = { //NOSONAR
         (byte)'7', (byte)'z', (byte)0xBC, (byte)0xAF, (byte)0x27, (byte)0x1C
     };
 

http://git-wip-us.apache.org/repos/asf/commons-compress/blob/5e0980f0/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
index a1fa568..8ff10c0 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
@@ -973,32 +973,32 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream {
     }
 
     /*
-     * Various ZIP constants
+     * Various ZIP constants shared between this class, ZipArchiveInputStream and ZipFile
      */
     /**
      * local file header signature
      */
-    static final byte[] LFH_SIG = ZipLong.LFH_SIG.getBytes();
+    static final byte[] LFH_SIG = ZipLong.LFH_SIG.getBytes(); //NOSONAR
     /**
      * data descriptor signature
      */
-    static final byte[] DD_SIG = ZipLong.DD_SIG.getBytes();
+    static final byte[] DD_SIG = ZipLong.DD_SIG.getBytes(); //NOSONAR
     /**
      * central file header signature
      */
-    static final byte[] CFH_SIG = ZipLong.CFH_SIG.getBytes();
+    static final byte[] CFH_SIG = ZipLong.CFH_SIG.getBytes(); //NOSONAR
     /**
      * end of central dir signature
      */
-    static final byte[] EOCD_SIG = ZipLong.getBytes(0X06054B50L);
+    static final byte[] EOCD_SIG = ZipLong.getBytes(0X06054B50L); //NOSONAR
     /**
      * ZIP64 end of central dir signature
      */
-    static final byte[] ZIP64_EOCD_SIG = ZipLong.getBytes(0X06064B50L);
+    static final byte[] ZIP64_EOCD_SIG = ZipLong.getBytes(0X06064B50L); //NOSONAR
     /**
      * ZIP64 end of central dir locator signature
      */
-    static final byte[] ZIP64_EOCD_LOC_SIG = ZipLong.getBytes(0X07064B50L);
+    static final byte[] ZIP64_EOCD_LOC_SIG = ZipLong.getBytes(0X07064B50L); //NOSONAR
 
     /**
      * Writes next block of compressed data to the output stream.


Mime
View raw message