langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
90 import com.sun.tools.javac.util.Names; |
90 import com.sun.tools.javac.util.Names; |
91 import com.sun.tools.javac.util.Options; |
91 import com.sun.tools.javac.util.Options; |
92 |
92 |
93 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING; |
93 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING; |
94 import static com.sun.tools.javac.code.Kinds.Kind.*; |
94 import static com.sun.tools.javac.code.Kinds.Kind.*; |
|
95 import com.sun.tools.javac.comp.Annotate; |
95 import static com.sun.tools.javac.comp.CompileStates.CompileState; |
96 import static com.sun.tools.javac.comp.CompileStates.CompileState; |
96 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*; |
97 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*; |
97 |
98 |
98 /** |
99 /** |
99 * Objects of this class hold and manage the state needed to support |
100 * Objects of this class hold and manage the state needed to support |
121 private final JavacElements elementUtils; |
122 private final JavacElements elementUtils; |
122 private final JavacTypes typeUtils; |
123 private final JavacTypes typeUtils; |
123 private final JavaCompiler compiler; |
124 private final JavaCompiler compiler; |
124 private final Modules modules; |
125 private final Modules modules; |
125 private final Types types; |
126 private final Types types; |
|
127 private final Annotate annotate; |
126 |
128 |
127 /** |
129 /** |
128 * Holds relevant state history of which processors have been |
130 * Holds relevant state history of which processors have been |
129 * used. |
131 * used. |
130 */ |
132 */ |
217 messager = new JavacMessager(context, this); |
219 messager = new JavacMessager(context, this); |
218 elementUtils = JavacElements.instance(context); |
220 elementUtils = JavacElements.instance(context); |
219 typeUtils = JavacTypes.instance(context); |
221 typeUtils = JavacTypes.instance(context); |
220 modules = Modules.instance(context); |
222 modules = Modules.instance(context); |
221 types = Types.instance(context); |
223 types = Types.instance(context); |
|
224 annotate = Annotate.instance(context); |
222 processorOptions = initProcessorOptions(); |
225 processorOptions = initProcessorOptions(); |
223 unmatchedProcessorOptions = initUnmatchedProcessorOptions(); |
226 unmatchedProcessorOptions = initUnmatchedProcessorOptions(); |
224 messages = JavacMessages.instance(context); |
227 messages = JavacMessages.instance(context); |
225 taskListener = MultiTaskListener.instance(context); |
228 taskListener = MultiTaskListener.instance(context); |
226 symtab = Symtab.instance(context); |
229 symtab = Symtab.instance(context); |
1254 filer.newRound(); |
1257 filer.newRound(); |
1255 messager.newRound(); |
1258 messager.newRound(); |
1256 compiler.newRound(); |
1259 compiler.newRound(); |
1257 modules.newRound(); |
1260 modules.newRound(); |
1258 types.newRound(); |
1261 types.newRound(); |
|
1262 annotate.newRound(); |
1259 |
1263 |
1260 boolean foundError = false; |
1264 boolean foundError = false; |
1261 |
1265 |
1262 for (ClassSymbol cs : symtab.getAllClasses()) { |
1266 for (ClassSymbol cs : symtab.getAllClasses()) { |
1263 if (cs.kind == ERR) { |
1267 if (cs.kind == ERR) { |