langtools/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java
changeset 41863 98b049c8b848
parent 41525 7f01e2b0619b
child 43646 017aba6e9260
equal deleted inserted replaced
41862:471a0cb1b986 41863:98b049c8b848
   636             return false;
   636             return false;
   637         }
   637         }
   638 
   638 
   639         // now the scanning phase
   639         // now the scanning phase
   640 
   640 
       
   641         boolean scanStatus = true;
       
   642 
   641         switch (scanMode) {
   643         switch (scanMode) {
   642             case LIST:
   644             case LIST:
   643                 for (DeprData dd : deprList) {
   645                 for (DeprData dd : deprList) {
   644                     if (!forRemoval || dd.isForRemoval()) {
   646                     if (!forRemoval || dd.isForRemoval()) {
   645                         out.println(Pretty.print(dd));
   647                         out.println(Pretty.print(dd));
   659                                            .map(File::toString)
   661                                            .map(File::toString)
   660                                            .collect(toList());
   662                                            .collect(toList());
   661                 Scan scan = new Scan(out, err, cp, db, verbose);
   663                 Scan scan = new Scan(out, err, cp, db, verbose);
   662 
   664 
   663                 for (String a : args) {
   665                 for (String a : args) {
   664                     boolean success;
   666                     boolean s;
   665 
       
   666                     if (a.endsWith(".jar")) {
   667                     if (a.endsWith(".jar")) {
   667                         success = scan.scanJar(a);
   668                         s = scan.scanJar(a);
       
   669                     } else if (a.endsWith(".class")) {
       
   670                         s = scan.processClassFile(a);
   668                     } else if (Files.isDirectory(Paths.get(a))) {
   671                     } else if (Files.isDirectory(Paths.get(a))) {
   669                         success = scan.scanDir(a);
   672                         s = scan.scanDir(a);
   670                     } else {
   673                     } else {
   671                         success = scan.processClassName(a.replace('.', '/'));
   674                         s = scan.processClassName(a.replace('.', '/'));
   672                     }
   675                     }
   673 
   676                     scanStatus = scanStatus && s;
   674                     if (!success) {
       
   675                         return false;
       
   676                     }
       
   677                 }
   677                 }
   678                 break;
   678                 break;
   679         }
   679         }
   680 
   680 
   681         return true;
   681         return scanStatus;
   682     }
   682     }
   683 
   683 
   684     /**
   684     /**
   685      * Programmatic main entry point: initializes the tool instance to
   685      * Programmatic main entry point: initializes the tool instance to
   686      * use stdout and stderr; runs the tool, passing command-line args;
   686      * use stdout and stderr; runs the tool, passing command-line args;