You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2013/05/29 01:48:55 UTC
svn commit: r1487167 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Author: sebb
Date: Tue May 28 23:48:55 2013
New Revision: 1487167
URL: http://svn.apache.org/r1487167
Log:
Replace Deque (1.6) with List, as we don't need the extra Deque functionality
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=1487167&r1=1487166&r2=1487167&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java Tue May 28 23:48:55 2013
@@ -25,7 +25,6 @@ import java.io.RandomAccessFile;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Deque;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -95,8 +94,8 @@ public class ZipFile {
/**
* Maps String to list of ZipArchiveEntrys, name -> actual entries.
*/
- private final Map<String, Deque<ZipArchiveEntry>> nameMap =
- new HashMap<String, Deque<ZipArchiveEntry>>(HASH_SIZE);
+ private final Map<String, List<ZipArchiveEntry>> nameMap =
+ new HashMap<String, List<ZipArchiveEntry>>(HASH_SIZE);
private static final class OffsetEntry {
private long headerOffset = -1;
@@ -308,8 +307,8 @@ public class ZipFile {
* {@code null} if not present.
*/
public ZipArchiveEntry getEntry(String name) {
- Deque<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
- return entriesOfThatName != null ? entriesOfThatName.getFirst() : null;
+ List<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
+ return entriesOfThatName != null ? entriesOfThatName.get(0) : null;
}
/**
@@ -322,7 +321,7 @@ public class ZipFile {
* @since 1.6
*/
public Iterator<ZipArchiveEntry> getEntries(String name) {
- Deque<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
+ List<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
return entriesOfThatName != null ? entriesOfThatName.iterator()
: Collections.<ZipArchiveEntry>emptyList().iterator();
}
@@ -927,12 +926,12 @@ public class ZipFile {
}
String name = ze.getName();
- Deque<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
+ List<ZipArchiveEntry> entriesOfThatName = nameMap.get(name);
if (entriesOfThatName == null) {
entriesOfThatName = new LinkedList<ZipArchiveEntry>();
nameMap.put(name, entriesOfThatName);
}
- entriesOfThatName.addLast(ze);
+ entriesOfThatName.add(ze);
}
}