< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsTask.java

Print this page
rev 3356 : [mq]: 8140281-deprecation-optional.get


 460         // Set module paths
 461         this.modulePaths = new ModulePaths(options.upgradeModulePath, options.modulePath, jarfiles);
 462 
 463         // add modules to dependency finder for analysis
 464         Map<String, Module> modules = modulePaths.getModules();
 465         modules.values().stream()
 466                .forEach(dependencyFinder::addModule);
 467 
 468         // If -m option is set, add the specified module and its transitive dependences
 469         // to the root set
 470         if (options.rootModule != null) {
 471             modulePaths.dependences(options.rootModule)
 472                        .forEach(dependencyFinder::addRoot);
 473         }
 474 
 475         // check if any module specified in -requires is missing
 476         Optional<String> req = options.requires.stream()
 477                 .filter(mn -> !modules.containsKey(mn))
 478                 .findFirst();
 479         if (req.isPresent()) {
 480             throw new BadArgs("err.module.not.found", req.get());
 481         }
 482 
 483         // classpath
 484         for (Path p : getClassPaths(options.classpath)) {
 485             if (Files.exists(p)) {
 486                 dependencyFinder.addClassPathArchive(p);
 487             }
 488         }
 489 
 490         // if -genmoduleinfo is not set, the input arguments are considered as
 491         // unnamed module.  Add them to the root set
 492         if (options.genModuleInfo == null) {
 493             // add root set
 494             for (String s : classes) {
 495                 Path p = Paths.get(s);
 496                 if (Files.exists(p)) {
 497                     // add to the initial root set
 498                     dependencyFinder.addRoot(p);
 499                 } else {
 500                     if (isValidClassName(s)) {




 460         // Set module paths
 461         this.modulePaths = new ModulePaths(options.upgradeModulePath, options.modulePath, jarfiles);
 462 
 463         // add modules to dependency finder for analysis
 464         Map<String, Module> modules = modulePaths.getModules();
 465         modules.values().stream()
 466                .forEach(dependencyFinder::addModule);
 467 
 468         // If -m option is set, add the specified module and its transitive dependences
 469         // to the root set
 470         if (options.rootModule != null) {
 471             modulePaths.dependences(options.rootModule)
 472                        .forEach(dependencyFinder::addRoot);
 473         }
 474 
 475         // check if any module specified in -requires is missing
 476         Optional<String> req = options.requires.stream()
 477                 .filter(mn -> !modules.containsKey(mn))
 478                 .findFirst();
 479         if (req.isPresent()) {
 480             throw new BadArgs("err.module.not.found", req.getWhenPresent());
 481         }
 482 
 483         // classpath
 484         for (Path p : getClassPaths(options.classpath)) {
 485             if (Files.exists(p)) {
 486                 dependencyFinder.addClassPathArchive(p);
 487             }
 488         }
 489 
 490         // if -genmoduleinfo is not set, the input arguments are considered as
 491         // unnamed module.  Add them to the root set
 492         if (options.genModuleInfo == null) {
 493             // add root set
 494             for (String s : classes) {
 495                 Path p = Paths.get(s);
 496                 if (Files.exists(p)) {
 497                     // add to the initial root set
 498                     dependencyFinder.addRoot(p);
 499                 } else {
 500                     if (isValidClassName(s)) {


< prev index next >