You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/24 18:41:04 UTC
(commons-compress) branch master updated (f4a8dd71b -> 1c8678ae6)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
from f4a8dd71b Sort members
new 8123ea758 Bump version for the next release to 1.27.0
new 1c8678ae6 Fix PMD UnnecessaryFullyQualifiedName
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 8 ++++----
src/changes/changes.xml | 1 +
.../compress/archivers/dump/DumpArchiveEntry.java | 4 ++--
.../compress/archivers/dump/DumpArchiveUtil.java | 4 ++--
.../compress/archivers/tar/TarArchiveEntry.java | 4 ++--
.../compress/archivers/zip/ZipArchiveEntry.java | 20 ++++++++++----------
.../compress/archivers/zip/ZipEightByteInteger.java | 4 ++--
.../compress/archivers/zip/ZipEncodingHelper.java | 3 +--
.../commons/compress/archivers/zip/ZipLong.java | 5 +++--
.../commons/compress/archivers/zip/ZipShort.java | 2 +-
.../commons/compress/archivers/zip/ZipUtil.java | 2 +-
.../bzip2/BZip2CompressorInputStream.java | 2 +-
.../bzip2/BZip2CompressorOutputStream.java | 4 ++--
.../harmony/pack200/Pack200PackerAdapter.java | 4 ++--
.../compress/harmony/pack200/PopulationCodec.java | 2 +-
.../harmony/unpack200/bytecode/ByteCode.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPClass.java | 2 +-
.../harmony/unpack200/bytecode/CPDouble.java | 2 +-
.../harmony/unpack200/bytecode/CPFieldRef.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPFloat.java | 2 +-
.../harmony/unpack200/bytecode/CPInteger.java | 2 +-
.../unpack200/bytecode/CPInterfaceMethodRef.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPLong.java | 2 +-
.../harmony/unpack200/bytecode/CPMethodRef.java | 2 +-
.../harmony/unpack200/bytecode/CPNameAndType.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPRef.java | 6 +++---
.../harmony/unpack200/bytecode/CPString.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPUTF8.java | 2 +-
.../harmony/unpack200/bytecode/CodeAttribute.java | 2 +-
.../unpack200/bytecode/ExceptionsAttribute.java | 2 +-
.../unpack200/bytecode/InnerClassesAttribute.java | 2 +-
.../bytecode/LocalVariableTableAttribute.java | 2 +-
.../bytecode/LocalVariableTypeTableAttribute.java | 2 +-
...untimeVisibleorInvisibleAnnotationsAttribute.java | 2 +-
...ibleorInvisibleParameterAnnotationsAttribute.java | 2 +-
35 files changed, 57 insertions(+), 56 deletions(-)
(commons-compress) 02/02: Fix PMD UnnecessaryFullyQualifiedName
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 1c8678ae6dab729e122487a17b32112c35f08566
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 24 14:40:58 2024 -0400
Fix PMD UnnecessaryFullyQualifiedName
---
src/changes/changes.xml | 1 +
.../compress/archivers/dump/DumpArchiveEntry.java | 4 ++--
.../compress/archivers/dump/DumpArchiveUtil.java | 4 ++--
.../compress/archivers/tar/TarArchiveEntry.java | 4 ++--
.../compress/archivers/zip/ZipArchiveEntry.java | 20 ++++++++++----------
.../compress/archivers/zip/ZipEightByteInteger.java | 4 ++--
.../compress/archivers/zip/ZipEncodingHelper.java | 3 +--
.../commons/compress/archivers/zip/ZipLong.java | 5 +++--
.../commons/compress/archivers/zip/ZipShort.java | 2 +-
.../commons/compress/archivers/zip/ZipUtil.java | 2 +-
.../bzip2/BZip2CompressorInputStream.java | 2 +-
.../bzip2/BZip2CompressorOutputStream.java | 4 ++--
.../harmony/pack200/Pack200PackerAdapter.java | 4 ++--
.../compress/harmony/pack200/PopulationCodec.java | 2 +-
.../harmony/unpack200/bytecode/ByteCode.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPClass.java | 2 +-
.../harmony/unpack200/bytecode/CPDouble.java | 2 +-
.../harmony/unpack200/bytecode/CPFieldRef.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPFloat.java | 2 +-
.../harmony/unpack200/bytecode/CPInteger.java | 2 +-
.../unpack200/bytecode/CPInterfaceMethodRef.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPLong.java | 2 +-
.../harmony/unpack200/bytecode/CPMethodRef.java | 2 +-
.../harmony/unpack200/bytecode/CPNameAndType.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPRef.java | 6 +++---
.../harmony/unpack200/bytecode/CPString.java | 2 +-
.../compress/harmony/unpack200/bytecode/CPUTF8.java | 2 +-
.../harmony/unpack200/bytecode/CodeAttribute.java | 2 +-
.../unpack200/bytecode/ExceptionsAttribute.java | 2 +-
.../unpack200/bytecode/InnerClassesAttribute.java | 2 +-
.../bytecode/LocalVariableTableAttribute.java | 2 +-
.../bytecode/LocalVariableTypeTableAttribute.java | 2 +-
...untimeVisibleorInvisibleAnnotationsAttribute.java | 2 +-
...ibleorInvisibleParameterAnnotationsAttribute.java | 2 +-
34 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 78607af9e..7844cbe3a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,6 +46,7 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="1.27.0" date="YYYY-MM-DD" description="This is a feature and maintenance release. Java 8 or later is required.">
<!-- FIX -->
+ <action type="add" dev="ggregory" due-to="Gary Gregory">Fix PMD UnnecessaryFullyQualifiedName.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add ArchiveInputStream.forEach(IOConsumer).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add ArchiveInputStream.iterator().</action>
diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
index 2e83956a2..e0bdff348 100644
--- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveEntry.java
@@ -179,7 +179,7 @@ public class DumpArchiveEntry implements ArchiveEntry {
public static Set<PERMISSION> find(final int code) {
final Set<PERMISSION> set = new HashSet<>();
- for (final PERMISSION p : PERMISSION.values()) {
+ for (final PERMISSION p : values()) {
if ((code & p.code) == p.code) {
set.add(p);
}
@@ -245,7 +245,7 @@ public class DumpArchiveEntry implements ArchiveEntry {
public static TYPE find(final int code) {
TYPE type = UNKNOWN;
- for (final TYPE t : TYPE.values()) {
+ for (final TYPE t : values()) {
if (code == t.code) {
type = t;
}
diff --git a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java
index ec26377f8..73e5be3c9 100644
--- a/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java
+++ b/src/main/java/org/apache/commons/compress/archivers/dump/DumpArchiveUtil.java
@@ -38,9 +38,9 @@ final class DumpArchiveUtil {
public static int calculateChecksum(final byte[] buffer) {
int calc = 0;
for (int i = 0; i < 256; i++) {
- calc += DumpArchiveUtil.convert32(buffer, 4 * i);
+ calc += convert32(buffer, 4 * i);
}
- return DumpArchiveConstants.CHECKSUM - (calc - DumpArchiveUtil.convert32(buffer, 28));
+ return DumpArchiveConstants.CHECKSUM - (calc - convert32(buffer, 28));
}
/**
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index fb3f9eced..d860c242f 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -266,7 +266,7 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants, EntryStreamO
private static Instant parseInstantFromDecimalSeconds(final String value) throws IOException {
// Validate field values to prevent denial of service attacks with BigDecimal values (see JDK-6560193)
- if (!TarArchiveEntry.PAX_EXTENDED_HEADER_FILE_TIMES_PATTERN.matcher(value).matches()) {
+ if (!PAX_EXTENDED_HEADER_FILE_TIMES_PATTERN.matcher(value).matches()) {
throw new IOException("Corrupted PAX header. Time field value is invalid '" + value + "'");
}
@@ -382,7 +382,7 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants, EntryStreamO
/** Extra, user supplied pax headers */
private final Map<String, String> extraPaxHeaders = new HashMap<>();
- private long dataOffset = EntryStreamOffsets.OFFSET_UNKNOWN;
+ private long dataOffset = OFFSET_UNKNOWN;
/**
* Constructs an empty entry and prepares the header values.
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
index aa12c61db..49d9c6d54 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
@@ -58,7 +58,7 @@ import org.apache.commons.compress.utils.TimeUtils;
*
* @NotThreadSafe
*/
-public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEntry, EntryStreamOffsets {
+public class ZipArchiveEntry extends ZipEntry implements ArchiveEntry, EntryStreamOffsets {
/**
* Indicates how the comment of this entry has been determined.
@@ -251,7 +251,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
}
/**
- * The {@link java.util.zip.ZipEntry} base class only supports the compression methods STORED and DEFLATED. We override the field so that any compression
+ * The {@link ZipEntry} base class only supports the compression methods STORED and DEFLATED. We override the field so that any compression
* methods can be used.
* <p>
* The default value -1 means that the method has not been specified.
@@ -261,7 +261,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
private int method = ZipMethod.UNKNOWN_CODE;
/**
- * The {@link java.util.zip.ZipEntry#setSize} method in the base class throws an IllegalArgumentException if the size is bigger than 2GB for Java versions
+ * The {@link ZipEntry#setSize} method in the base class throws an IllegalArgumentException if the size is bigger than 2GB for Java versions
* < 7 and even in Java 7+ if the implementation in java.util.zip doesn't support Zip64 itself (it is an optional feature).
* <p>
* We need to keep our own size information for Zip64 support.
@@ -352,7 +352,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
* @param entry the entry to get fields from
* @throws ZipException on error
*/
- private ZipArchiveEntry(final Function<ZipShort, ZipExtraField> extraFieldFactory, final java.util.zip.ZipEntry entry) throws ZipException {
+ private ZipArchiveEntry(final Function<ZipShort, ZipExtraField> extraFieldFactory, final ZipEntry entry) throws ZipException {
super(entry);
this.extraFieldFactory = extraFieldFactory;
setName(entry.getName());
@@ -413,7 +413,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
* @param entry the entry to get fields from
* @throws ZipException on error
*/
- public ZipArchiveEntry(final java.util.zip.ZipEntry entry) throws ZipException {
+ public ZipArchiveEntry(final ZipEntry entry) throws ZipException {
this(null, entry);
}
@@ -460,7 +460,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
* @throws ZipException on error
*/
public ZipArchiveEntry(final ZipArchiveEntry entry) throws ZipException {
- this((java.util.zip.ZipEntry) entry);
+ this((ZipEntry) entry);
setInternalAttributes(entry.getInternalAttributes());
setExternalAttributes(entry.getExternalAttributes());
setExtraFields(entry.getAllExtraFieldsNoCopy());
@@ -779,10 +779,10 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
}
/**
- * Wraps {@link java.util.zip.ZipEntry#getTime} with a {@link Date} as the entry's last modified date.
+ * Wraps {@link ZipEntry#getTime} with a {@link Date} as the entry's last modified date.
*
* <p>
- * Changes to the implementation of {@link java.util.zip.ZipEntry#getTime} leak through and the returned value may depend on your local time zone as well as
+ * Changes to the implementation of {@link ZipEntry#getTime()} leak through and the returned value may depend on your local time zone as well as
* your version of Java.
* </p>
*/
@@ -1519,7 +1519,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
}
/**
- * Workaround for the fact that, as of Java 17, {@link java.util.zip.ZipEntry} does not properly modify the entry's {@code xdostime} field, only setting
+ * Workaround for the fact that, as of Java 17, {@link ZipEntry} does not properly modify the entry's {@code xdostime} field, only setting
* {@code mtime}. While this is not strictly necessary, it's better to maintain the same behavior between this and the NTFS field.
*/
private void updateTimeFromExtendedTimestampField() {
@@ -1548,7 +1548,7 @@ public class ZipArchiveEntry extends java.util.zip.ZipEntry implements ArchiveEn
}
/**
- * Workaround for the fact that, as of Java 17, {@link java.util.zip.ZipEntry} parses NTFS timestamps with a maximum precision of microseconds, which is
+ * Workaround for the fact that, as of Java 17, {@link ZipEntry} parses NTFS timestamps with a maximum precision of microseconds, which is
* lower than the 100ns precision provided by this extra field.
*/
private void updateTimeFromNtfsField() {
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
index 8af931710..f9fae8eac 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEightByteInteger.java
@@ -175,7 +175,7 @@ public final class ZipEightByteInteger implements Serializable {
* @param offset the offset to start
*/
public ZipEightByteInteger(final byte[] bytes, final int offset) {
- value = ZipEightByteInteger.getValue(bytes, offset);
+ value = getValue(bytes, offset);
}
/**
@@ -207,7 +207,7 @@ public final class ZipEightByteInteger implements Serializable {
* @return value as eight bytes in big-endian order
*/
public byte[] getBytes() {
- return ZipEightByteInteger.getBytes(value);
+ return getBytes(value);
}
/**
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
index c64c30751..92dfdfcdc 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
@@ -21,7 +21,6 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
import java.nio.charset.UnsupportedCharsetException;
import org.apache.commons.io.Charsets;
@@ -34,7 +33,7 @@ public abstract class ZipEncodingHelper {
/**
* UTF-8.
*/
- static final ZipEncoding ZIP_ENCODING_UTF_8 = getZipEncoding(StandardCharsets.UTF_8);
+ static final ZipEncoding ZIP_ENCODING_UTF_8 = getZipEncoding(UTF_8);
/**
* Instantiates a ZIP encoding. An NIO based character set encoder/decoder will be returned. As a special case, if the character set is UTF-8, the NIO
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
index 90cf3df3b..ba833f502 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
@@ -28,6 +28,7 @@ import org.apache.commons.compress.utils.ByteUtils;
* @Immutable
*/
public final class ZipLong implements Cloneable, Serializable {
+
private static final long serialVersionUID = 1L;
/** Central File Header Signature */
@@ -135,7 +136,7 @@ public final class ZipLong implements Cloneable, Serializable {
* @param offset the offset to start
*/
public ZipLong(final byte[] bytes, final int offset) {
- value = ZipLong.getValue(bytes, offset);
+ value = getValue(bytes, offset);
}
/**
@@ -187,7 +188,7 @@ public final class ZipLong implements Cloneable, Serializable {
* @return value as four bytes in big-endian order
*/
public byte[] getBytes() {
- return ZipLong.getBytes(value);
+ return getBytes(value);
}
/**
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
index 246bc284a..935ad4992 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
@@ -97,7 +97,7 @@ public final class ZipShort implements Cloneable, Serializable {
* @param offset the offset to start
*/
public ZipShort(final byte[] bytes, final int offset) {
- value = ZipShort.getValue(bytes, offset);
+ value = getValue(bytes, offset);
}
/**
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
index f0802e52f..9639d788c 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
@@ -268,7 +268,7 @@ public abstract class ZipUtil {
if (l < 0 && l >= Integer.MIN_VALUE) {
// If someone passes in a -2, they probably mean 4294967294
// (For example, UNIX UID/GID's are 32 bit unsigned.)
- l = ZipUtil.adjustToLong((int) l);
+ l = adjustToLong((int) l);
}
return BigInteger.valueOf(l);
}
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
index efcf76c53..fe5dc5c48 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
@@ -76,7 +76,7 @@ public class BZip2CompressorInputStream extends CompressorInputStream implements
// ===============
Data(final int blockSize100k) {
- this.ll8 = new byte[blockSize100k * BZip2Constants.BASEBLOCKSIZE];
+ this.ll8 = new byte[blockSize100k * BASEBLOCKSIZE];
}
/**
diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
index f2e92d084..334e9d892 100644
--- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
@@ -180,7 +180,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream implemen
int origPtr;
Data(final int blockSize100k) {
- final int n = blockSize100k * BZip2Constants.BASEBLOCKSIZE;
+ final int n = blockSize100k * BASEBLOCKSIZE;
this.block = new byte[n + 1 + NUM_OVERSHOOT_BYTES];
this.fmap = new int[n];
this.sfmap = new char[2 * n];
@@ -438,7 +438,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream implemen
this.out = out;
/* 20 is just a paranoia constant */
- this.allowableBlockSize = this.blockSize100k * BZip2Constants.BASEBLOCKSIZE - 20;
+ this.allowableBlockSize = this.blockSize100k * BASEBLOCKSIZE - 20;
init();
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200PackerAdapter.java b/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200PackerAdapter.java
index 8e5debe65..1f0365b64 100644
--- a/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200PackerAdapter.java
+++ b/src/main/java/org/apache/commons/compress/harmony/pack200/Pack200PackerAdapter.java
@@ -76,7 +76,7 @@ public class Pack200PackerAdapter extends Pack200Adapter implements Packer {
}
completed(0);
try {
- new org.apache.commons.compress.harmony.pack200.Archive(file, out, options).pack();
+ new Archive(file, out, options).pack();
} catch (final Pack200Exception e) {
throw new IOException("Failed to pack Jar:" + e);
}
@@ -92,7 +92,7 @@ public class Pack200PackerAdapter extends Pack200Adapter implements Packer {
final PackingOptions options = new PackingOptions();
try {
- new org.apache.commons.compress.harmony.pack200.Archive(in, out, options).pack();
+ new Archive(in, out, options).pack();
} catch (final Pack200Exception e) {
throw new IOException("Failed to pack Jar:" + e);
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/pack200/PopulationCodec.java b/src/main/java/org/apache/commons/compress/harmony/pack200/PopulationCodec.java
index d32c55701..d929dfe04 100644
--- a/src/main/java/org/apache/commons/compress/harmony/pack200/PopulationCodec.java
+++ b/src/main/java/org/apache/commons/compress/harmony/pack200/PopulationCodec.java
@@ -88,7 +88,7 @@ public class PopulationCodec extends Codec {
// if tokenCodec needs to be derived from the T, L and K values
if (tokenCodec == null) {
if (k < 256) {
- tokenCodec = Codec.BYTE1;
+ tokenCodec = BYTE1;
} else {
// if k >= 256, b >= 2
int b = 1;
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ByteCode.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ByteCode.java
index 7f95fd355..a10f9dd8a 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ByteCode.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ByteCode.java
@@ -50,7 +50,7 @@ public class ByteCode extends ClassFileEntry {
private int[] byteCodeTargets;
protected ByteCode(final int opcode) {
- this(opcode, ClassFileEntry.NONE);
+ this(opcode, NONE);
}
protected ByteCode(final int opcode, final ClassFileEntry[] nested) {
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPClass.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPClass.java
index 5052fba5e..529332d50 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPClass.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPClass.java
@@ -43,7 +43,7 @@ public class CPClass extends ConstantPoolEntry {
* @throws NullPointerException if name is null
*/
public CPClass(final CPUTF8 name, final int globalIndex) {
- super(ConstantPoolEntry.CP_Class, globalIndex);
+ super(CP_Class, globalIndex);
this.name = Objects.requireNonNull(name, "name").underlyingString();
this.utf8 = name;
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
index c90442a27..bf9330591 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPDouble.java
@@ -25,7 +25,7 @@ import java.io.IOException;
public class CPDouble extends CPConstantNumber {
public CPDouble(final Double value, final int globalIndex) {
- super(ConstantPoolEntry.CP_Double, value, globalIndex);
+ super(CP_Double, value, globalIndex);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java
index 64316f9bc..802f620d8 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFieldRef.java
@@ -35,7 +35,7 @@ public class CPFieldRef extends ConstantPoolEntry {
private int cachedHashCode;
public CPFieldRef(final CPClass className, final CPNameAndType descriptor, final int globalIndex) {
- super(ConstantPoolEntry.CP_Fieldref, globalIndex);
+ super(CP_Fieldref, globalIndex);
this.className = className;
this.nameAndType = descriptor;
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
index 7f55902b9..0bcf36ec7 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPFloat.java
@@ -25,7 +25,7 @@ import java.io.IOException;
public class CPFloat extends CPConstantNumber {
public CPFloat(final Float value, final int globalIndex) {
- super(ConstantPoolEntry.CP_Float, value, globalIndex);
+ super(CP_Float, value, globalIndex);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
index 1552b6f78..fe6b52418 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInteger.java
@@ -25,7 +25,7 @@ import java.io.IOException;
public class CPInteger extends CPConstantNumber {
public CPInteger(final Integer value, final int globalIndex) {
- super(ConstantPoolEntry.CP_Integer, value, globalIndex);
+ super(CP_Integer, value, globalIndex);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInterfaceMethodRef.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInterfaceMethodRef.java
index 346a391c2..b288cd7d3 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInterfaceMethodRef.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPInterfaceMethodRef.java
@@ -23,7 +23,7 @@ public class CPInterfaceMethodRef extends CPRef {
private int cachedHashCode;
public CPInterfaceMethodRef(final CPClass className, final CPNameAndType descriptor, final int globalIndex) {
- super(ConstantPoolEntry.CP_InterfaceMethodref, className, descriptor, globalIndex);
+ super(CP_InterfaceMethodref, className, descriptor, globalIndex);
}
private void generateHashCode() {
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
index 9cb59383a..d72272e45 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPLong.java
@@ -25,7 +25,7 @@ import java.io.IOException;
public class CPLong extends CPConstantNumber {
public CPLong(final Long value, final int globalIndex) {
- super(ConstantPoolEntry.CP_Long, value, globalIndex);
+ super(CP_Long, value, globalIndex);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPMethodRef.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPMethodRef.java
index 101ae86c5..784f204c7 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPMethodRef.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPMethodRef.java
@@ -26,7 +26,7 @@ public class CPMethodRef extends CPRef {
private int cachedHashCode;
public CPMethodRef(final CPClass className, final CPNameAndType descriptor, final int globalIndex) {
- super(ConstantPoolEntry.CP_Methodref, className, descriptor, globalIndex);
+ super(CP_Methodref, className, descriptor, globalIndex);
}
private void generateHashCode() {
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPNameAndType.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPNameAndType.java
index 4395d716c..0fc6c49a3 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPNameAndType.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPNameAndType.java
@@ -48,7 +48,7 @@ public class CPNameAndType extends ConstantPoolEntry {
* @throws NullPointerException if name or descriptor is null
*/
public CPNameAndType(final CPUTF8 name, final CPUTF8 descriptor, final int globalIndex) {
- super(ConstantPoolEntry.CP_NameAndType, globalIndex);
+ super(CP_NameAndType, globalIndex);
this.name = Objects.requireNonNull(name, "name");
this.descriptor = Objects.requireNonNull(descriptor, "descriptor");
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPRef.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPRef.java
index 90353639c..16895a7ef 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPRef.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPRef.java
@@ -91,11 +91,11 @@ public abstract class CPRef extends ConstantPoolEntry {
public String toString() {
if (cachedToString == null) {
String type;
- if (getTag() == ConstantPoolEntry.CP_Fieldref) {
+ if (getTag() == CP_Fieldref) {
type = "FieldRef"; //$NON-NLS-1$
- } else if (getTag() == ConstantPoolEntry.CP_Methodref) {
+ } else if (getTag() == CP_Methodref) {
type = "MethoddRef"; //$NON-NLS-1$
- } else if (getTag() == ConstantPoolEntry.CP_InterfaceMethodref) {
+ } else if (getTag() == CP_InterfaceMethodref) {
type = "InterfaceMethodRef"; //$NON-NLS-1$
} else {
type = "unknown"; //$NON-NLS-1$
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
index d4c2c715e..6b4c6c8fb 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPString.java
@@ -32,7 +32,7 @@ public class CPString extends CPConstant {
private int cachedHashCode;
public CPString(final CPUTF8 value, final int globalIndex) {
- super(ConstantPoolEntry.CP_String, value, globalIndex);
+ super(CP_String, value, globalIndex);
this.name = value;
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPUTF8.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPUTF8.java
index be46e3a6b..e3ff30107 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPUTF8.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CPUTF8.java
@@ -44,7 +44,7 @@ public class CPUTF8 extends ConstantPoolEntry {
* @throws NullPointerException if utf8 is null
*/
public CPUTF8(final String utf8, final int globalIndex) {
- super(ConstantPoolEntry.CP_UTF8, globalIndex);
+ super(CP_UTF8, globalIndex);
this.utf8 = Objects.requireNonNull(utf8, "utf8");
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java
index b9ae31361..6c603db26 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/CodeAttribute.java
@@ -124,7 +124,7 @@ public class CodeAttribute extends BCIRenumberedAttribute {
nestedEntries.add(catchType);
}
}
- return nestedEntries.toArray(ClassFileEntry.NONE);
+ return nestedEntries.toArray(NONE);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ExceptionsAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ExceptionsAttribute.java
index 8735b56de..711dd5258 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ExceptionsAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/ExceptionsAttribute.java
@@ -87,7 +87,7 @@ public class ExceptionsAttribute extends Attribute {
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
- result = prime * result + ExceptionsAttribute.hashCode(exceptions);
+ result = prime * result + hashCode(exceptions);
return result;
}
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/InnerClassesAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/InnerClassesAttribute.java
index 6b4751a09..3b4f88118 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/InnerClassesAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/InnerClassesAttribute.java
@@ -147,7 +147,7 @@ public class InnerClassesAttribute extends Attribute {
@Override
protected ClassFileEntry[] getNestedClassFileEntries() {
- return nestedClassFileEntries.toArray(ClassFileEntry.NONE);
+ return nestedClassFileEntries.toArray(NONE);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java
index 64c0e0e0b..2af61cb21 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTableAttribute.java
@@ -70,7 +70,7 @@ public class LocalVariableTableAttribute extends BCIRenumberedAttribute {
nestedEntries.add(names[i]);
nestedEntries.add(descriptors[i]);
}
- return nestedEntries.toArray(ClassFileEntry.NONE);
+ return nestedEntries.toArray(NONE);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java
index 51662c530..43636cfd9 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/LocalVariableTypeTableAttribute.java
@@ -70,7 +70,7 @@ public class LocalVariableTypeTableAttribute extends BCIRenumberedAttribute {
nestedEntries.add(names[i]);
nestedEntries.add(signatures[i]);
}
- return nestedEntries.toArray(ClassFileEntry.NONE);
+ return nestedEntries.toArray(NONE);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
index ca39a5027..8a94c57e4 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleAnnotationsAttribute.java
@@ -51,7 +51,7 @@ public class RuntimeVisibleorInvisibleAnnotationsAttribute extends AnnotationsAt
for (final Annotation annotation : annotations) {
nested.addAll(annotation.getClassFileEntries());
}
- return nested.toArray(ClassFileEntry.NONE);
+ return nested.toArray(NONE);
}
@Override
diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
index 7770fa552..70c283f51 100644
--- a/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
+++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/bytecode/RuntimeVisibleorInvisibleParameterAnnotationsAttribute.java
@@ -96,7 +96,7 @@ public class RuntimeVisibleorInvisibleParameterAnnotationsAttribute extends Anno
for (final ParameterAnnotation parameterAnnotation : parameterAnnotations) {
nested.addAll(parameterAnnotation.getClassFileEntries());
}
- return nested.toArray(ClassFileEntry.NONE);
+ return nested.toArray(NONE);
}
@Override
(commons-compress) 01/02: Bump version for the next release to 1.27.0
Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 8123ea758f748542b560e3e1069c7262c9c0bc05
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri May 24 12:57:42 2024 -0400
Bump version for the next release to 1.27.0
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index a6aa0bcf6..b5f82c7d1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
</parent>
<artifactId>commons-compress</artifactId>
- <version>1.26.3-SNAPSHOT</version>
+ <version>1.27.0-SNAPSHOT</version>
<name>Apache Commons Compress</name>
<url>https://commons.apache.org/proper/commons-compress/</url>
<inceptionYear>2002</inceptionYear> <!-- from NOTICE file -->
@@ -45,9 +45,9 @@ Brotli, Zstandard and ar, cpio, jar, tar, zip, dump, 7z, arj.
<commons.jira.id>COMPRESS</commons.jira.id>
<commons.jira.pid>12310904</commons.jira.pid>
<!-- configuration bits for cutting a release candidate -->
- <commons.release.version>1.26.2</commons.release.version>
- <commons.release.next>1.26.3</commons.release.next>
- <commons.bc.version>1.26.1</commons.bc.version>
+ <commons.release.version>1.27.0</commons.release.version>
+ <commons.release.next>1.27.1</commons.release.next>
+ <commons.bc.version>1.26.2</commons.bc.version>
<commons.rc.version>RC1</commons.rc.version>
<mockito.version>4.11.0</mockito.version>