rmannibucau commented on code in PR #480: URL: https://github.com/apache/commons-compress/pull/480#discussion_r1485215496
########## src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java: ########## @@ -113,24 +116,24 @@ public ZipExtraField onUnparseableExtraField(final byte[] data, final int off, f /** * Static registry of known extra fields. */ - private static final Map<ZipShort, Class<?>> IMPLEMENTATIONS; + private static final Map<ZipShort, Supplier<ZipExtraField>> IMPLEMENTATIONS; static { - IMPLEMENTATIONS = new ConcurrentHashMap<>(); - register(AsiExtraField.class); - register(X5455_ExtendedTimestamp.class); - register(X7875_NewUnix.class); - register(JarMarker.class); - register(UnicodePathExtraField.class); - register(UnicodeCommentExtraField.class); - register(Zip64ExtendedInformationExtraField.class); - register(X000A_NTFS.class); - register(X0014_X509Certificates.class); - register(X0015_CertificateIdForFile.class); - register(X0016_CertificateIdForCentralDirectory.class); - register(X0017_StrongEncryptionHeader.class); - register(X0019_EncryptionRecipientCertificateList.class); - register(ResourceAlignmentExtraField.class); + IMPLEMENTATIONS = new HashMap<>(); // it can't be used at runtime by design so no need to be concurrent Review Comment: well it already does not work if done at runtime in a not safe context so I wouldn't be sorry and ultimately if you enable it at runtime how do you remove it today? will fix the since edit: updated -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org