Skip to content

Commit

Permalink
Use Map rather than a specific implementation
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1800915 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jul 5, 2017
1 parent f0da424 commit d6459a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.jar.JarEntry;
Expand All @@ -38,7 +37,7 @@ public abstract class AbstractArchiveResourceSet extends AbstractResourceSet {
private String baseUrlString;

private JarFile archive = null;
protected HashMap<String,JarEntry> archiveEntries = null;
protected Map<String,JarEntry> archiveEntries = null;
protected final Object archiveLock = new Object();
private long archiveUseCount = 0;

Expand Down Expand Up @@ -174,7 +173,7 @@ public final Set<String> listWebAppPaths(String path) {
* @return The archives entries mapped to their names or null if
* {@link #getArchiveEntry(String)} should be used.
*/
protected abstract HashMap<String,JarEntry> getArchiveEntries(boolean single);
protected abstract Map<String,JarEntry> getArchiveEntries(boolean single);


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.net.MalformedURLException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

Expand Down Expand Up @@ -59,7 +60,7 @@ public AbstractSingleArchiveResourceSet(WebResourceRoot root, String webAppMount


@Override
protected HashMap<String,JarEntry> getArchiveEntries(boolean single) {
protected Map<String,JarEntry> getArchiveEntries(boolean single) {
synchronized (archiveLock) {
if (archiveEntries == null && !single) {
JarFile jarFile = null;
Expand Down
3 changes: 2 additions & 1 deletion java/org/apache/catalina/webresources/JarWarResourceSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.io.InputStream;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
Expand Down Expand Up @@ -94,7 +95,7 @@ protected WebResource createArchiveResource(JarEntry jarEntry,
* returned.
*/
@Override
protected HashMap<String,JarEntry> getArchiveEntries(boolean single) {
protected Map<String,JarEntry> getArchiveEntries(boolean single) {
synchronized (archiveLock) {
if (archiveEntries == null) {
JarFile warFile = null;
Expand Down

0 comments on commit d6459a4

Please sign in to comment.