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 2023/11/12 17:55:29 UTC
(commons-compress) branch master updated (bb6ac1603 -> 897024392)
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 bb6ac1603 Rename misleading local variable name
new 12d3278e0 Format tweak
new 12c214c50 Format tweak
new 897024392 Simplify
The 3 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:
.../compress/archivers/cpio/CpioArchiveEntry.java | 15 +++----
.../compress/archivers/jar/JarArchiveEntry.java | 50 ++++++++++++++--------
2 files changed, 37 insertions(+), 28 deletions(-)
(commons-compress) 01/03: Format tweak
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 12d3278e027db1adc6f3f6e94c3e5451b7e4a04a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Nov 12 12:37:34 2023 -0500
Format tweak
---
.../commons/compress/archivers/cpio/CpioArchiveEntry.java | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
index 4e1988a3b..64cdd63e9 100644
--- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
@@ -286,16 +286,14 @@ public class CpioArchiveEntry implements CpioConstants, ArchiveEntry {
*
* @since 1.1
*/
- public CpioArchiveEntry(final short format, final File inputFile,
- final String entryName) {
+ public CpioArchiveEntry(final short format, final File inputFile, final String entryName) {
this(format, entryName, inputFile.isFile() ? inputFile.length() : 0);
- if (inputFile.isDirectory()){
+ if (inputFile.isDirectory()) {
setMode(C_ISDIR);
- } else if (inputFile.isFile()){
+ } else if (inputFile.isFile()) {
setMode(C_ISREG);
} else {
- throw new IllegalArgumentException("Cannot determine type of file "
- + inputFile.getName());
+ throw new IllegalArgumentException("Cannot determine type of file " + inputFile.getName());
}
// TODO set other fields as needed
setTime(inputFile.lastModified() / 1000);
(commons-compress) 02/03: Format tweak
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 12c214c50271c2ad75e39150e502876075da59dd
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Nov 12 12:39:17 2023 -0500
Format tweak
---
.../org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
index 64cdd63e9..707ff2c18 100644
--- a/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveEntry.java
@@ -884,10 +884,7 @@ public class CpioArchiveEntry implements CpioConstants, ArchiveEntry {
case C_ISNWK:
break;
default:
- throw new IllegalArgumentException(
- "Unknown mode. "
- + "Full: " + Long.toHexString(mode)
- + " Masked: " + Long.toHexString(maskedMode));
+ throw new IllegalArgumentException("Unknown mode. " + "Full: " + Long.toHexString(mode) + " Masked: " + Long.toHexString(maskedMode));
}
this.mode = mode;
(commons-compress) 03/03: Simplify
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 8970243929aad82bb93351c6c8a549067367380a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Nov 12 12:43:05 2023 -0500
Simplify
Javadoc
---
.../compress/archivers/jar/JarArchiveEntry.java | 50 ++++++++++++++--------
1 file changed, 32 insertions(+), 18 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
index 5874344cc..7d734fba2 100644
--- a/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
@@ -19,7 +19,6 @@
package org.apache.commons.compress.archivers.jar;
import java.security.cert.Certificate;
-import java.util.Arrays;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
import java.util.zip.ZipEntry;
@@ -34,23 +33,41 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
*/
public class JarArchiveEntry extends ZipArchiveEntry {
- // These are always null - see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
- private final Attributes manifestAttributes = null;
- private final Certificate[] certificates = null;
-
+ /**
+ * Constructs a new instance.
+ *
+ * @param entry See super.
+ * @throws ZipException See super.
+ */
public JarArchiveEntry(final JarEntry entry) throws ZipException {
super(entry);
-
}
+ /**
+ * Constructs a new instance.
+ *
+ * @param name See super.
+ */
public JarArchiveEntry(final String name) {
super(name);
}
+ /**
+ * Constructs a new instance.
+ *
+ * @param entry See super.
+ * @throws ZipException See super.
+ */
public JarArchiveEntry(final ZipArchiveEntry entry) throws ZipException {
super(entry);
}
+ /**
+ * Constructs a new instance.
+ *
+ * @param entry See super.
+ * @throws ZipException See super.
+ */
public JarArchiveEntry(final ZipEntry entry) throws ZipException {
super(entry);
}
@@ -59,32 +76,29 @@ public class JarArchiveEntry extends ZipArchiveEntry {
* Gets a copy of the list of certificates or null if there are none.
*
* @return Always returns null in the current implementation
- *
* @deprecated since 1.5, not currently implemented
*/
@Deprecated
public Certificate[] getCertificates() {
- if (certificates != null) { // never true currently // NOSONAR
- return Arrays.copyOf(certificates, certificates.length);
- }
- /*
- * Note, the method
- * Certificate[] java.util.jar.JarEntry.getCertificates()
- * also returns null or the list of certificates (but not copied)
- */
+ //
+ // Note, the method
+ // Certificate[] java.util.jar.JarEntry.getCertificates()
+ // also returns null or the list of certificates (but not copied)
+ //
+ // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
return null;
}
/**
- * This method is not implemented and won't ever be.
- * The JVM equivalent has a different name {@link java.util.jar.JarEntry#getAttributes()}
+ * This method is not implemented and won't ever be. The JVM equivalent has a different name {@link java.util.jar.JarEntry#getAttributes()}
*
* @deprecated since 1.5, do not use; always returns null
* @return Always returns null.
*/
@Deprecated
public Attributes getManifestAttributes() {
- return manifestAttributes;
+ // see https://issues.apache.org/jira/browse/COMPRESS-18 for discussion
+ return null;
}
}