src/share/classes/com/sun/tools/javac/util/Paths.java

changeset 14
58039502942e
parent 1
9a66ca7c79fa
     1.1 --- a/src/share/classes/com/sun/tools/javac/util/Paths.java	Thu Mar 13 13:42:38 2008 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/util/Paths.java	Fri Mar 14 16:09:30 2008 -0700
     1.3 @@ -38,13 +38,8 @@
     1.4  import java.util.LinkedHashSet;
     1.5  import java.util.Iterator;
     1.6  import java.util.StringTokenizer;
     1.7 -import java.util.zip.ZipException;
     1.8  import java.util.zip.ZipFile;
     1.9  import com.sun.tools.javac.code.Lint;
    1.10 -import com.sun.tools.javac.util.Context;
    1.11 -import com.sun.tools.javac.util.Log;
    1.12 -import com.sun.tools.javac.util.Options;
    1.13 -import com.sun.tools.javac.util.Position;
    1.14  import java.util.ArrayList;
    1.15  import java.util.concurrent.ConcurrentHashMap;
    1.16  import java.util.concurrent.locks.Lock;
    1.17 @@ -70,7 +65,10 @@
    1.18      protected static final Context.Key<Paths> pathsKey =
    1.19          new Context.Key<Paths>();
    1.20  
    1.21 -    /** Get the Paths instance for this context. */
    1.22 +    /** Get the Paths instance for this context.
    1.23 +     *  @param context the context
    1.24 +     *  @return the Paths instance for this context
    1.25 +     */
    1.26      public static Paths instance(Context context) {
    1.27          Paths instance = context.get(pathsKey);
    1.28          if (instance == null)
    1.29 @@ -89,7 +87,7 @@
    1.30  
    1.31      private static boolean NON_BATCH_MODE = System.getProperty("nonBatchMode") != null;// TODO: Use -XD compiler switch for this.
    1.32      private static Map<File, PathEntry> pathExistanceCache = new ConcurrentHashMap<File, PathEntry>();
    1.33 -    private static Map<File, java.util.List<String>> manifestEntries = new ConcurrentHashMap<File, java.util.List<String>>();
    1.34 +    private static Map<File, java.util.List<File>> manifestEntries = new ConcurrentHashMap<File, java.util.List<File>>();
    1.35      private static Map<File, Boolean> isDirectory = new ConcurrentHashMap<File, Boolean>();
    1.36      private static Lock lock = new ReentrantLock();
    1.37  
    1.38 @@ -369,13 +367,13 @@
    1.39          // filenames, but if we do, we should redo all path-related code.
    1.40          private void addJarClassPath(File jarFile, boolean warn) {
    1.41              try {
    1.42 -                java.util.List<String> manifestsList = manifestEntries.get(jarFile);
    1.43 +                java.util.List<File> manifestsList = manifestEntries.get(jarFile);
    1.44                  if (!NON_BATCH_MODE) {
    1.45                      lock.lock();
    1.46                      try {
    1.47                          if (manifestsList != null) {
    1.48 -                            for (String entr : manifestsList) {
    1.49 -                                addFile(new File(entr), warn);
    1.50 +                            for (File entr : manifestsList) {
    1.51 +                                addFile(entr, warn);
    1.52                              }
    1.53                              return;
    1.54                          }
    1.55 @@ -386,7 +384,7 @@
    1.56                  }
    1.57  
    1.58                  if (!NON_BATCH_MODE) {
    1.59 -                    manifestsList = new ArrayList<String>();
    1.60 +                    manifestsList = new ArrayList<File>();
    1.61                      manifestEntries.put(jarFile, manifestsList);
    1.62                  }
    1.63  
    1.64 @@ -412,7 +410,7 @@
    1.65                          if (!NON_BATCH_MODE) {
    1.66                              lock.lock();
    1.67                              try {
    1.68 -                                manifestsList.add(elt);
    1.69 +                                manifestsList.add(f);
    1.70                              }
    1.71                              finally {
    1.72                                  lock.unlock();

mercurial