langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java
changeset 42815 050370edaade
parent 42408 d6f09ae68eab
child 42823 58864b03c7b9
equal deleted inserted replaced
42814:058fc03646d9 42815:050370edaade
   474     }
   474     }
   475 
   475 
   476     private Location getModuleLocation(JavaFileObject fo, Name pkgName) throws IOException {
   476     private Location getModuleLocation(JavaFileObject fo, Name pkgName) throws IOException {
   477         // For now, just check module source path.
   477         // For now, just check module source path.
   478         // We may want to check source path as well.
   478         // We may want to check source path as well.
   479         return fileManager.getLocationForModule(StandardLocation.MODULE_SOURCE_PATH,
   479         Location loc =
   480                 fo, (pkgName == null) ? null : pkgName.toString());
   480                 fileManager.getLocationForModule(StandardLocation.MODULE_SOURCE_PATH,
       
   481                                                  fo, (pkgName == null) ? null : pkgName.toString());
       
   482         if (loc == null) {
       
   483             Location sourceOutput = fileManager.hasLocation(StandardLocation.SOURCE_OUTPUT) ?
       
   484                     StandardLocation.SOURCE_OUTPUT : StandardLocation.CLASS_OUTPUT;
       
   485             loc =
       
   486                 fileManager.getLocationForModule(sourceOutput,
       
   487                                                  fo, (pkgName == null) ? null : pkgName.toString());
       
   488         }
       
   489 
       
   490         return loc;
   481     }
   491     }
   482 
   492 
   483     private void checkSpecifiedModule(List<JCCompilationUnit> trees, JCDiagnostic.Error error) {
   493     private void checkSpecifiedModule(List<JCCompilationUnit> trees, JCDiagnostic.Error error) {
   484         if (moduleOverride != null) {
   494         if (moduleOverride != null) {
   485             JavaFileObject prev = log.useSource(trees.head.sourcefile);
   495             JavaFileObject prev = log.useSource(trees.head.sourcefile);
   610             public String toString() {
   620             public String toString() {
   611                 return "SourceCompleter: " + tree.sourcefile.getName();
   621                 return "SourceCompleter: " + tree.sourcefile.getName();
   612             }
   622             }
   613 
   623 
   614         };
   624         };
       
   625     }
       
   626 
       
   627     public boolean isRootModule(ModuleSymbol module) {
       
   628         Assert.checkNonNull(rootModules);
       
   629         return rootModules.contains(module);
   615     }
   630     }
   616 
   631 
   617     class ModuleVisitor extends JCTree.Visitor {
   632     class ModuleVisitor extends JCTree.Visitor {
   618         private ModuleSymbol sym;
   633         private ModuleSymbol sym;
   619         private final Set<ModuleSymbol> allRequires = new HashSet<>();
   634         private final Set<ModuleSymbol> allRequires = new HashSet<>();