langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/main/JavaCompiler.java
equal
deleted
inserted
replaced
919 options.remove(XLINT_CUSTOM.primaryName + LintCategory.OPTIONS.option); |
919 options.remove(XLINT_CUSTOM.primaryName + LintCategory.OPTIONS.option); |
920 |
920 |
921 start_msec = now(); |
921 start_msec = now(); |
922 |
922 |
923 try { |
923 try { |
924 initProcessAnnotations(processors); |
924 initProcessAnnotations(processors, sourceFileObjects, classnames); |
925 |
925 |
926 for (String className : classnames) { |
926 for (String className : classnames) { |
927 int sep = className.indexOf('/'); |
927 int sep = className.indexOf('/'); |
928 if (sep != -1) { |
928 if (sep != -1) { |
929 modules.addExtraAddModules(className.substring(0, sep)); |
929 modules.addExtraAddModules(className.substring(0, sep)); |
1121 * the compilation unit. |
1121 * the compilation unit. |
1122 * |
1122 * |
1123 * @param processors user provided annotation processors to bypass |
1123 * @param processors user provided annotation processors to bypass |
1124 * discovery, {@code null} means that no processors were provided |
1124 * discovery, {@code null} means that no processors were provided |
1125 */ |
1125 */ |
1126 public void initProcessAnnotations(Iterable<? extends Processor> processors) { |
1126 public void initProcessAnnotations(Iterable<? extends Processor> processors, |
|
1127 Collection<? extends JavaFileObject> initialFiles, |
|
1128 Collection<String> initialClassNames) { |
1127 // Process annotations if processing is not disabled and there |
1129 // Process annotations if processing is not disabled and there |
1128 // is at least one Processor available. |
1130 // is at least one Processor available. |
1129 if (options.isSet(PROC, "none")) { |
1131 if (options.isSet(PROC, "none")) { |
1130 processAnnotations = false; |
1132 processAnnotations = false; |
1131 } else if (procEnvImpl == null) { |
1133 } else if (procEnvImpl == null) { |
1139 keepComments = true; |
1141 keepComments = true; |
1140 genEndPos = true; |
1142 genEndPos = true; |
1141 if (!taskListener.isEmpty()) |
1143 if (!taskListener.isEmpty()) |
1142 taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING)); |
1144 taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING)); |
1143 deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log); |
1145 deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log); |
|
1146 procEnvImpl.getFiler().setInitialState(initialFiles, initialClassNames); |
1144 } else { // free resources |
1147 } else { // free resources |
1145 procEnvImpl.close(); |
1148 procEnvImpl.close(); |
1146 } |
1149 } |
1147 } |
1150 } |
1148 } |
1151 } |