garydgregory commented on code in PR #378:
URL: https://github.com/apache/commons-compress/pull/378#discussion_r1438855379


##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java:
##########
@@ -368,9 +369,14 @@ public static void closeQuietly(final ZipFile zipFile) {
     private final List<ZipArchiveEntry> entries = new LinkedList<>();
 
     /**
-     * Maps String to list of ZipArchiveEntrys, name -> actual entries.
+     * Maps a string to the first entry by that name.
      */
-    private final Map<String, LinkedList<ZipArchiveEntry>> nameMap = new 
HashMap<>(HASH_SIZE);
+    private final Map<String, ZipArchiveEntry> nameMap = new 
HashMap<>(HASH_SIZE);
+
+    /**
+     * If multiple entries have the same name, maps the name to entries by 
that name.
+     */
+    private Map<String, List<ZipArchiveEntry>> duplicateNameMap;

Review Comment:
   I  REALLY don't like that. When you look at the pack200 code, which is 
written at the pre-generics Java version, and some of its lists, you can't tell 
if some of the lists are buggy, sloppy, or trying to be clever. That or the 
lack of generics let's you get away with not having fully thought through the 
hierarchy of types you put in those lists.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to