[lang] LANG-1320: correct id in changes.xml
Repository: commons-lang Updated Branches: refs/heads/master 7c19a1ff4 -> 9f2fe9bb8 LANG-1320: correct id in changes.xml Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/9f2fe9bb Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/9f2fe9bb Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/9f2fe9bb Branch: refs/heads/master Commit: 9f2fe9bb80065fc249c61c897a0434e9ff48bbf6 Parents: 7c19a1f Author: pascalschumacherAuthored: Tue May 23 00:34:59 2017 +0200 Committer: pascalschumacher Committed: Tue May 23 00:34:59 2017 +0200 -- src/changes/changes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/9f2fe9bb/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 69b95d7..1761d8e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -53,7 +53,7 @@ The type attribute can be add,update,fix,remove. Implement HashSetvBitSetTest using JMH Add JMH maven dependencies Add null filter to ReflectionToStringBuilder -LocaleUtils#toLocale does not support language followed by UN M.49 numeric-3 area code followed by variant +LocaleUtils#toLocale does not support language followed by UN M.49 numeric-3 area code followed by variant Clarify or improve behaviour of int-based indexOf methods in StringUtils Add method for converting string to an array of code points RandomStringUtils random method can overflow and return characters outside of specified range
[3/4] commons-compress git commit: COMPRESS-394 adapt test, DEFLATE requires version 2.0
COMPRESS-394 adapt test, DEFLATE requires version 2.0 Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/12edac73 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/12edac73 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/12edac73 Branch: refs/heads/master Commit: 12edac73ec454bfbdd634af474e140cca7522774 Parents: b1dcd19 Author: Stefan BodewigAuthored: Mon May 22 15:57:19 2017 +0200 Committer: Stefan Bodewig Committed: Mon May 22 15:57:19 2017 +0200 -- .../apache/commons/compress/archivers/zip/Zip64SupportIT.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/12edac73/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java -- diff --git a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java index 7d5a036..ba30c3f 100644 --- a/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java +++ b/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java @@ -2101,7 +2101,7 @@ public class Zip64SupportIT { // version made by 20, 0, // version needed to extract -10, 0, +20, 0, // GPB (EFS + *no* Data Descriptor) 0, 8, // method @@ -2147,7 +2147,7 @@ public class Zip64SupportIT { // sig (byte) 0x50, (byte) 0x4b, 3, 4, // version needed to extract -10, 0, +20, 0, // GPB (EFS bit, no DD) 0, 8, // method
[2/4] commons-compress git commit: simplify code a little
simplify code a little Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/b1dcd19c Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/b1dcd19c Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/b1dcd19c Branch: refs/heads/master Commit: b1dcd19c2f87a57e4c4b96aebeb4a226f10af636 Parents: 83b60fb Author: Stefan BodewigAuthored: Mon May 22 15:21:54 2017 +0200 Committer: Stefan Bodewig Committed: Mon May 22 15:21:54 2017 +0200 -- .../archivers/zip/ZipArchiveOutputStream.java| 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/b1dcd19c/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 ac329b4..077344d 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 @@ -758,18 +758,19 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { final Zip64ExtendedInformationExtraField z64 = getZip64Extra(entry.entry); -// just a placeholder, real data will be in data -// descriptor or inserted later via SeekableByteChannel -ZipEightByteInteger size = ZipEightByteInteger.ZERO; -ZipEightByteInteger compressedSize = ZipEightByteInteger.ZERO; -if (phased){ +ZipEightByteInteger size, compressedSize; +if (phased) { +// sizes are already known size = new ZipEightByteInteger(entry.entry.getSize()); compressedSize = new ZipEightByteInteger(entry.entry.getCompressedSize()); } else if (entry.entry.getMethod() == STORED && entry.entry.getSize() != ArchiveEntry.SIZE_UNKNOWN) { // actually, we already know the sizes -size = new ZipEightByteInteger(entry.entry.getSize()); -compressedSize = size; +compressedSize = size = new ZipEightByteInteger(entry.entry.getSize()); +} else { +// just a placeholder, real data will be in data +// descriptor or inserted later via SeekableByteChannel +compressedSize = size = ZipEightByteInteger.ZERO; } z64.setSize(size); z64.setCompressedSize(compressedSize);
[4/4] commons-compress git commit: COMPRESS-394/395 use same "version needed to extract" in LFH and CDH
COMPRESS-394/395 use same "version needed to extract" in LFH and CDH ... and skip data descriptor when copying raw entries Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/d75b8985 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/d75b8985 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/d75b8985 Branch: refs/heads/master Commit: d75b89856ef29bbec6784cd6aa714eafe0eeb312 Parents: 12edac7 Author: Stefan BodewigAuthored: Mon May 22 18:11:06 2017 +0200 Committer: Stefan Bodewig Committed: Mon May 22 18:11:06 2017 +0200 -- src/changes/changes.xml | 9 + .../archivers/zip/ZipArchiveOutputStream.java | 74 .../archivers/zip/DataDescriptorTest.java | 189 +++ 3 files changed, 239 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/d75b8985/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 203a2fd..3a1b513 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -44,6 +44,15 @@ The type attribute can be add,update,fix,remove. + +Make sure "version needed to extract" in local file header and +central directory of a ZIP archive agree with each other. +Also ensure the version is set to 2.0 if DEFLATE is used. + + +Don't use a data descriptor in ZIP archives when copying a raw +entry that already knows its size and CRC information. + http://git-wip-us.apache.org/repos/asf/commons-compress/blob/d75b8985/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 077344d..63aeba7 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 @@ -202,9 +202,9 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { private static final byte[] ONE = ZipLong.getBytes(1L); /** - * Holds the offsets of the LFH starts for each entry. + * Holds some book-keeping data for each entry. */ -private final Map offsets = +private final Map metaData = new HashMap<>(); /** @@ -473,7 +473,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { cdLength = streamCompressor.getTotalBytesWritten() - cdOffset; writeZip64CentralDirectory(); writeCentralDirectoryEnd(); -offsets.clear(); +metaData.clear(); entries.clear(); streamCompressor.close(); finished = true; @@ -539,7 +539,9 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { rewriteSizesAndCrc(actuallyNeedsZip64); } -writeDataDescriptor(entry.entry); +if (!phased) { +writeDataDescriptor(entry.entry); +} entry = null; } @@ -695,7 +697,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { // do some cleanup: // * rewrite version needed to extract channel.position(entry.localDataStart - 5 * SHORT); - writeOut(ZipShort.getBytes(versionNeededToExtractMethod(entry.entry.getMethod(; + writeOut(ZipShort.getBytes(versionNeededToExtract(entry.entry.getMethod(), false, false))); // * remove ZIP64 extra so it doesn't get written // to the central directory @@ -1029,7 +1031,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { final long localHeaderStart = streamCompressor.getTotalBytesWritten(); final byte[] localHeader = createLocalFileHeader(ze, name, encodable, phased, localHeaderStart); -offsets.put(ze, localHeaderStart); +metaData.put(ze, new EntryMetaData(localHeaderStart, usesDataDescriptor(ze.getMethod(), phased))); entry.localDataStart = localHeaderStart + LFH_CRC_OFFSET; // At crc offset writeCounted(localHeader); entry.dataStart = streamCompressor.getTotalBytesWritten(); @@ -1070,14 +1072,11 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { //store method in local variable to prevent multiple method calls
[1/4] commons-compress git commit: fix "javadocs"
Repository: commons-compress Updated Branches: refs/heads/master 5903142b3 -> d75b89856 fix "javadocs" Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/83b60fbe Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/83b60fbe Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/83b60fbe Branch: refs/heads/master Commit: 83b60fbeb00ef26b969060ecbe5443108e3193f8 Parents: 5903142 Author: Stefan BodewigAuthored: Mon May 22 15:21:02 2017 +0200 Committer: Stefan Bodewig Committed: Mon May 22 15:21:02 2017 +0200 -- .../compress/archivers/zip/ZipArchiveOutputStream.java | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/83b60fbe/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 5ad6742..ac329b4 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 @@ -640,10 +640,9 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { } /** - * Ensures the current entry's size and CRC information is set to - * the values just written, verifies it isn't too big in the - * Zip64Mode.Never case and returns whether the entry would - * require a Zip64 extra field. + * Verifies the sizes aren't too big in the Zip64Mode.Never case + * and returns whether the entry would require a Zip64 extra + * field. */ private boolean checkIfNeedsZip64(final Zip64Mode effectiveMode) throws ZipException { @@ -1563,7 +1562,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream { /** * If the mode is AsNeeded and the entry is a compressed entry of - * unknown size that gets written to a non-seekable stream the + * unknown size that gets written to a non-seekable stream then * change the default to Never. * * @since 1.3
commons-compress git commit: claim sensitive name for JPMS automatic modules
Repository: commons-compress Updated Branches: refs/heads/master 8a6bb5623 -> 5903142b3 claim sensitive name for JPMS automatic modules Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/5903142b Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/5903142b Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/5903142b Branch: refs/heads/master Commit: 5903142b3856c88ba987824f9b990cc21135cafc Parents: 8a6bb56 Author: Stefan BodewigAuthored: Mon May 22 14:19:28 2017 +0200 Committer: Stefan Bodewig Committed: Mon May 22 14:19:28 2017 +0200 -- pom.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/5903142b/pom.xml -- diff --git a/pom.xml b/pom.xml index 9a1e8de..941e2e0 100644 --- a/pom.xml +++ b/pom.xml @@ -241,6 +241,7 @@ jar, tar, zip, dump, 7z, arj. org.apache.commons.compress.archivers.Lister org.apache.commons.compress + org.apache.commons.compress
[lang] Deprecate CharEncoding and direct users to Java 7 classes
Repository: commons-lang Updated Branches: refs/heads/master 53def5014 -> 7c19a1ff4 Deprecate CharEncoding and direct users to Java 7 classes Java 7 introduced java.nio.charset.StandardCharsets, which negates the need for our CharEncoding method. Additionally, the constants in the class now point to the constants defined in Java 7. Fixes: LANG-1334 Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/7c19a1ff Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/7c19a1ff Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/7c19a1ff Branch: refs/heads/master Commit: 7c19a1ff4c217f03c0be62baf1169d689f566825 Parents: 53def50 Author: duncanAuthored: Mon May 22 13:16:29 2017 +0100 Committer: duncan Committed: Mon May 22 13:16:29 2017 +0100 -- src/changes/changes.xml | 1 + .../org/apache/commons/lang3/CharEncoding.java | 19 +-- .../apache/commons/lang3/CharEncodingTest.java | 1 + 3 files changed, 15 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/7c19a1ff/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 9f52a9b..69b95d7 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -46,6 +46,7 @@ The type attribute can be add,update,fix,remove. +Deprecate CharEncoding in favour of java.nio.charset.StandardCharsets MultilineRecursiveToStringStyle StackOverflowError when object is an array Increase test coverage of ToStringBuilder class to 100% Add a method in StringUtils to extract only digits out of input string http://git-wip-us.apache.org/repos/asf/commons-lang/blob/7c19a1ff/src/main/java/org/apache/commons/lang3/CharEncoding.java -- diff --git a/src/main/java/org/apache/commons/lang3/CharEncoding.java b/src/main/java/org/apache/commons/lang3/CharEncoding.java index 7fe9296..65dca33 100644 --- a/src/main/java/org/apache/commons/lang3/CharEncoding.java +++ b/src/main/java/org/apache/commons/lang3/CharEncoding.java @@ -19,6 +19,7 @@ package org.apache.commons.lang3; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.StandardCharsets; /** * Character encoding names required of every implementation of the Java platform. @@ -32,7 +33,11 @@ import java.nio.charset.IllegalCharsetNameException; * * @see http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html;>JRE character encoding names * @since 2.1 + * @deprecated Java 7 introduced {@link StandardCharsets}, which defines these constants as + * {@link Charset} objects. Use {@link Charset#name()} to get the string values provided in this class. + * This class will be removed in a future release. */ +@Deprecated public class CharEncoding { /** @@ -40,7 +45,7 @@ public class CharEncoding { * * Every implementation of the Java platform is required to support this character encoding. */ -public static final String ISO_8859_1 = "ISO-8859-1"; +public static final String ISO_8859_1 = StandardCharsets.ISO_8859_1.name(); /** * Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block @@ -48,7 +53,7 @@ public class CharEncoding { * * Every implementation of the Java platform is required to support this character encoding. */ -public static final String US_ASCII = "US-ASCII"; +public static final String US_ASCII = StandardCharsets.US_ASCII.name(); /** * Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial @@ -56,28 +61,28 @@ public class CharEncoding { * * Every implementation of the Java platform is required to support this character encoding. */ -public static final String UTF_16 = "UTF-16"; +public static final String UTF_16 = StandardCharsets.UTF_16.name(); /** * Sixteen-bit Unicode Transformation Format, big-endian byte order. * * Every implementation of the Java platform is required to support this character encoding. */ -public static final String UTF_16BE = "UTF-16BE"; +public static final String UTF_16BE = StandardCharsets.UTF_16BE.name(); /** * Sixteen-bit Unicode Transformation Format, little-endian byte order. * * Every implementation of the Java platform is required to support this character encoding. */ -public static final String UTF_16LE = "UTF-16LE"; +public static final String UTF_16LE =