src/share/classes/com/sun/tools/javac/file/JavacFileManager.java

changeset 1111
d2cbb77469ed
parent 923
6970d9fb8e02
child 1116
d830d28fc72e
     1.1 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Oct 19 16:56:05 2011 +0100
     1.2 +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Oct 19 15:29:46 2011 -0700
     1.3 @@ -25,7 +25,6 @@
     1.4  
     1.5  package com.sun.tools.javac.file;
     1.6  
     1.7 -import java.util.Comparator;
     1.8  import java.io.ByteArrayOutputStream;
     1.9  import java.io.File;
    1.10  import java.io.FileNotFoundException;
    1.11 @@ -41,6 +40,7 @@
    1.12  import java.util.Arrays;
    1.13  import java.util.Collection;
    1.14  import java.util.Collections;
    1.15 +import java.util.Comparator;
    1.16  import java.util.EnumSet;
    1.17  import java.util.HashMap;
    1.18  import java.util.Iterator;
    1.19 @@ -54,6 +54,7 @@
    1.20  import javax.tools.JavaFileObject;
    1.21  import javax.tools.StandardJavaFileManager;
    1.22  
    1.23 +import com.sun.tools.javac.code.Lint;
    1.24  import com.sun.tools.javac.file.RelativePath.RelativeFile;
    1.25  import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
    1.26  import com.sun.tools.javac.main.OptionName;
    1.27 @@ -83,10 +84,6 @@
    1.28              return buffer.toString().toCharArray();
    1.29      }
    1.30  
    1.31 -    /** Encapsulates knowledge of paths
    1.32 -     */
    1.33 -    private Paths paths;
    1.34 -
    1.35      private FSInfo fsInfo;
    1.36  
    1.37      private boolean contextUseOptimizedZip;
    1.38 @@ -154,13 +151,6 @@
    1.39      @Override
    1.40      public void setContext(Context context) {
    1.41          super.setContext(context);
    1.42 -        if (paths == null) {
    1.43 -            paths = Paths.instance(context);
    1.44 -        } else {
    1.45 -            // Reuse the Paths object as it stores the locations that
    1.46 -            // have been set with setLocation, etc.
    1.47 -            paths.setContext(context);
    1.48 -        }
    1.49  
    1.50          fsInfo = FSInfo.instance(context);
    1.51  
    1.52 @@ -179,7 +169,7 @@
    1.53  
    1.54      @Override
    1.55      public boolean isDefaultBootClassPath() {
    1.56 -        return paths.isDefaultBootClassPath();
    1.57 +        return searchPaths.isDefaultBootClassPath();
    1.58      }
    1.59  
    1.60      public JavaFileObject getFileForInput(String name) {
    1.61 @@ -493,7 +483,7 @@
    1.62       */
    1.63      private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException {
    1.64          File origZipFileName = zipFileName;
    1.65 -        if (!ignoreSymbolFile && paths.isDefaultBootClassPathRtJar(zipFileName)) {
    1.66 +        if (!ignoreSymbolFile && searchPaths.isDefaultBootClassPathRtJar(zipFileName)) {
    1.67              File file = zipFileName.getParentFile().getParentFile(); // ${java.home}
    1.68              if (new File(file.getName()).equals(new File("jre")))
    1.69                  file = file.getParentFile();
    1.70 @@ -780,7 +770,7 @@
    1.71          } else if (location == SOURCE_OUTPUT) {
    1.72              dir = (getSourceOutDir() != null ? getSourceOutDir() : getClassOutDir());
    1.73          } else {
    1.74 -            Iterable<? extends File> path = paths.getPathForLocation(location);
    1.75 +            Iterable<? extends File> path = searchPaths.getPathForLocation(location);
    1.76              dir = null;
    1.77              for (File f: path) {
    1.78                  dir = f;
    1.79 @@ -815,7 +805,7 @@
    1.80          throws IOException
    1.81      {
    1.82          nullCheck(location);
    1.83 -        paths.lazy();
    1.84 +        searchPaths.lazy();
    1.85  
    1.86          final File dir = location.isOutputLocation() ? getOutputDirectory(path) : null;
    1.87  
    1.88 @@ -824,7 +814,7 @@
    1.89          else if (location == SOURCE_OUTPUT)
    1.90              sourceOutDir = getOutputLocation(dir, S);
    1.91          else
    1.92 -            paths.setPathForLocation(location, path);
    1.93 +            searchPaths.setPathForLocation(location, path);
    1.94      }
    1.95      // where
    1.96          private File getOutputDirectory(Iterable<? extends File> path) throws IOException {
    1.97 @@ -854,13 +844,13 @@
    1.98  
    1.99      public Iterable<? extends File> getLocation(Location location) {
   1.100          nullCheck(location);
   1.101 -        paths.lazy();
   1.102 +        searchPaths.lazy();
   1.103          if (location == CLASS_OUTPUT) {
   1.104              return (getClassOutDir() == null ? null : List.of(getClassOutDir()));
   1.105          } else if (location == SOURCE_OUTPUT) {
   1.106              return (getSourceOutDir() == null ? null : List.of(getSourceOutDir()));
   1.107          } else
   1.108 -            return paths.getPathForLocation(location);
   1.109 +            return searchPaths.getPathForLocation(location);
   1.110      }
   1.111  
   1.112      private File getClassOutDir() {

mercurial