langtools/src/share/classes/com/sun/tools/javac/file/Locations.java
changeset 22163 3651128c74eb
parent 22153 f9f06fcca59d
child 24897 655b72d7b96e
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
   142      * @param emptyPathDefault The value to substitute for empty path elements,
   142      * @param emptyPathDefault The value to substitute for empty path elements,
   143      *  or null, to ignore empty path elements
   143      *  or null, to ignore empty path elements
   144      * @return The elements of the path
   144      * @return The elements of the path
   145      */
   145      */
   146     private static Iterable<File> getPathEntries(String path, File emptyPathDefault) {
   146     private static Iterable<File> getPathEntries(String path, File emptyPathDefault) {
   147         ListBuffer<File> entries = new ListBuffer<File>();
   147         ListBuffer<File> entries = new ListBuffer<>();
   148         int start = 0;
   148         int start = 0;
   149         while (start <= path.length()) {
   149         while (start <= path.length()) {
   150             int sep = path.indexOf(File.pathSeparatorChar, start);
   150             int sep = path.indexOf(File.pathSeparatorChar, start);
   151             if (sep == -1)
   151             if (sep == -1)
   152                 sep = path.length();
   152                 sep = path.length();
   165      */
   165      */
   166     private class Path extends LinkedHashSet<File> {
   166     private class Path extends LinkedHashSet<File> {
   167         private static final long serialVersionUID = 0;
   167         private static final long serialVersionUID = 0;
   168 
   168 
   169         private boolean expandJarClassPaths = false;
   169         private boolean expandJarClassPaths = false;
   170         private Set<File> canonicalValues = new HashSet<File>();
   170         private Set<File> canonicalValues = new HashSet<>();
   171 
   171 
   172         public Path expandJarClassPaths(boolean x) {
   172         public Path expandJarClassPaths(boolean x) {
   173             expandJarClassPaths = x;
   173             expandJarClassPaths = x;
   174             return this;
   174             return this;
   175         }
   175         }
   508      * Setting -bootclasspath or -Xbootclasspath overrides any existing
   508      * Setting -bootclasspath or -Xbootclasspath overrides any existing
   509      * value for -Xbootclasspath/p: and -Xbootclasspath/a:.
   509      * value for -Xbootclasspath/p: and -Xbootclasspath/a:.
   510      */
   510      */
   511     private class BootClassPathLocationHandler extends LocationHandler {
   511     private class BootClassPathLocationHandler extends LocationHandler {
   512         private Collection<File> searchPath;
   512         private Collection<File> searchPath;
   513         final Map<Option, String> optionValues = new EnumMap<Option,String>(Option.class);
   513         final Map<Option, String> optionValues = new EnumMap<>(Option.class);
   514 
   514 
   515         /**
   515         /**
   516          * rt.jar as found on the default bootclasspath.
   516          * rt.jar as found on the default bootclasspath.
   517          * If the user specified a bootclasspath, null is used.
   517          * If the user specified a bootclasspath, null is used.
   518          */
   518          */
   646 
   646 
   647     Map<Location, LocationHandler> handlersForLocation;
   647     Map<Location, LocationHandler> handlersForLocation;
   648     Map<Option, LocationHandler> handlersForOption;
   648     Map<Option, LocationHandler> handlersForOption;
   649 
   649 
   650     void initHandlers() {
   650     void initHandlers() {
   651         handlersForLocation = new HashMap<Location, LocationHandler>();
   651         handlersForLocation = new HashMap<>();
   652         handlersForOption = new EnumMap<Option, LocationHandler>(Option.class);
   652         handlersForOption = new EnumMap<>(Option.class);
   653 
   653 
   654         LocationHandler[] handlers = {
   654         LocationHandler[] handlers = {
   655             new BootClassPathLocationHandler(),
   655             new BootClassPathLocationHandler(),
   656             new ClassPathLocationHandler(),
   656             new ClassPathLocationHandler(),
   657             new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),
   657             new SimpleLocationHandler(StandardLocation.SOURCE_PATH, Option.SOURCEPATH),