commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [3/5] commons-compress git commit: don't modify method parameters
Date Thu, 06 Jul 2017 07:53:56 GMT
don't modify method parameters


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

Branch: refs/heads/master
Commit: cd90f9ea24823be24133075130cc7cf899527620
Parents: 1ce02e0
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Thu Jul 6 09:47:20 2017 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Thu Jul 6 09:47:20 2017 +0200

----------------------------------------------------------------------
 .../apache/commons/compress/archivers/zip/NioZipEncoding.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-compress/blob/cd90f9ea/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java b/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java
index b23832e..323f838 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java
@@ -134,14 +134,15 @@ class NioZipEncoding implements ZipEncoding, HasCharset {
     }
 
     private static ByteBuffer encodeFully(CharsetEncoder enc, CharBuffer cb, ByteBuffer out)
{
+        ByteBuffer o = out;
         while (cb.hasRemaining()) {
-            CoderResult result = enc.encode(cb, out, false);
+            CoderResult result = enc.encode(cb, o, false);
             if (result.isOverflow()) {
                 int increment = estimateIncrementalEncodingSize(enc, cb.remaining());
-                out = ZipEncodingHelper.growBufferBy(out, increment);
+                o = ZipEncodingHelper.growBufferBy(o, increment);
             }
         }
-        return out;
+        return o;
     }
 
     private static final char[] HEX_CHARS = new char[] {


Mime
View raw message