89 * - add module support: --add-modules, --module-path, module arg
90 * - load deprecation declarations from a designated class library instead
91 * of the JDK
92 * - load deprecation declarations from a module
93 * - scan a module (but a modular jar can be treated just a like an ordinary jar)
94 * - multi-version jar
95 */
96 public class Main implements DiagnosticListener<JavaFileObject> {
97 final PrintStream out;
98 final PrintStream err;
99 final List<File> bootClassPath = new ArrayList<>();
100 final List<File> classPath = new ArrayList<>();
101 final List<File> systemModules = new ArrayList<>();
102 final List<String> options = new ArrayList<>();
103 final List<String> comments = new ArrayList<>();
104
105 // Valid releases need to match what the compiler supports.
106 // Keep these updated manually until there's a compiler API
107 // that allows querying of supported releases.
108 final Set<String> releasesWithoutForRemoval = Set.of("6", "7", "8");
109 final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12");
110
111 final Set<String> validReleases;
112 {
113 Set<String> temp = new HashSet<>(releasesWithoutForRemoval);
114 temp.addAll(releasesWithForRemoval);
115 validReleases = Set.of(temp.toArray(new String[0]));
116 }
117
118 boolean verbose = false;
119 boolean forRemoval = false;
120
121 final JavaCompiler compiler;
122 final StandardJavaFileManager fm;
123
124 List<DeprData> deprList; // non-null after successful load phase
125
126 /**
127 * Processes a collection of class names. Names should fully qualified
128 * names in the form "pkg.pkg.pkg.classname".
129 *
|
89 * - add module support: --add-modules, --module-path, module arg
90 * - load deprecation declarations from a designated class library instead
91 * of the JDK
92 * - load deprecation declarations from a module
93 * - scan a module (but a modular jar can be treated just a like an ordinary jar)
94 * - multi-version jar
95 */
96 public class Main implements DiagnosticListener<JavaFileObject> {
97 final PrintStream out;
98 final PrintStream err;
99 final List<File> bootClassPath = new ArrayList<>();
100 final List<File> classPath = new ArrayList<>();
101 final List<File> systemModules = new ArrayList<>();
102 final List<String> options = new ArrayList<>();
103 final List<String> comments = new ArrayList<>();
104
105 // Valid releases need to match what the compiler supports.
106 // Keep these updated manually until there's a compiler API
107 // that allows querying of supported releases.
108 final Set<String> releasesWithoutForRemoval = Set.of("6", "7", "8");
109 final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12", "13");
110
111 final Set<String> validReleases;
112 {
113 Set<String> temp = new HashSet<>(releasesWithoutForRemoval);
114 temp.addAll(releasesWithForRemoval);
115 validReleases = Set.of(temp.toArray(new String[0]));
116 }
117
118 boolean verbose = false;
119 boolean forRemoval = false;
120
121 final JavaCompiler compiler;
122 final StandardJavaFileManager fm;
123
124 List<DeprData> deprList; // non-null after successful load phase
125
126 /**
127 * Processes a collection of class names. Names should fully qualified
128 * names in the form "pkg.pkg.pkg.classname".
129 *
|