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
The following commit(s) were added to refs/heads/master by this push: new 221012574 Sort members 221012574 is described below commit 2210125748547d6468fe13ac407cf1c352e8fe1d Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Jun 28 17:18:14 2024 -0400 Sort members --- .../compress/archivers/zip/ZipArchiveEntry.java | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) 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 023c4a336..1ae2e3fc6 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 @@ -341,32 +341,6 @@ public class ZipArchiveEntry extends ZipEntry implements ArchiveEntry, EntryStre } } - /** - * Creates a new ZIP entry with fields taken from the specified ZIP entry. - * - * <p> - * Assumes the entry represents a directory if and only if the name ends with a forward slash "/". - * </p> - * - * @param extraFieldFactory the extra field lookup factory. - * @param entry the entry to get fields from - * @throws ZipException on error - */ - private ZipArchiveEntry(final Function<ZipShort, ZipExtraField> extraFieldFactory, final ZipEntry entry) throws ZipException { - super(entry); - this.extraFieldFactory = extraFieldFactory; - setName(entry.getName()); - final byte[] extra = entry.getExtra(); - if (extra != null) { - setExtraFields(parseExtraFields(extra, true, ExtraFieldParsingMode.BEST_EFFORT)); - } else { - // initializes extra data to an empty byte array - setExtra(); - } - setMethod(entry.getMethod()); - this.size = entry.getSize(); - } - /** * Creates a new ZIP entry taking some information from the given path and using the provided name. * @@ -410,11 +384,23 @@ public class ZipArchiveEntry extends ZipEntry implements ArchiveEntry, EntryStre * Assumes the entry represents a directory if and only if the name ends with a forward slash "/". * </p> * + * @param extraFieldFactory the extra field lookup factory. * @param entry the entry to get fields from * @throws ZipException on error */ - public ZipArchiveEntry(final ZipEntry entry) throws ZipException { - this(null, entry); + private ZipArchiveEntry(final Function<ZipShort, ZipExtraField> extraFieldFactory, final ZipEntry entry) throws ZipException { + super(entry); + this.extraFieldFactory = extraFieldFactory; + setName(entry.getName()); + final byte[] extra = entry.getExtra(); + if (extra != null) { + setExtraFields(parseExtraFields(extra, true, ExtraFieldParsingMode.BEST_EFFORT)); + } else { + // initializes extra data to an empty byte array + setExtra(); + } + setMethod(entry.getMethod()); + this.size = entry.getSize(); } /** @@ -469,6 +455,20 @@ public class ZipArchiveEntry extends ZipEntry implements ArchiveEntry, EntryStre setGeneralPurposeBit(other == null ? null : (GeneralPurposeBit) other.clone()); } + /** + * Creates a new ZIP entry with fields taken from the specified ZIP entry. + * + * <p> + * Assumes the entry represents a directory if and only if the name ends with a forward slash "/". + * </p> + * + * @param entry the entry to get fields from + * @throws ZipException on error + */ + public ZipArchiveEntry(final ZipEntry entry) throws ZipException { + this(null, entry); + } + /** * Adds an extra field - replacing an already present extra field of the same type. *