langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Mon Feb 28 12:19:18 2011 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Mon Feb 28 13:37:48 2011 -0800
@@ -807,8 +807,6 @@
final JavaCompiler compiler;
/** The log for the round. */
final Log log;
- /** The number of warnings in the previous round. */
- final int priorWarnings;
/** The ASTs to be compiled. */
List<JCCompilationUnit> roots;
@@ -826,10 +824,10 @@
private Round(Context context, int number, int priorWarnings) {
this.context = context;
this.number = number;
- this.priorWarnings = priorWarnings;
compiler = JavaCompiler.instance(context);
log = Log.instance(context);
+ log.nwarnings += priorWarnings;
log.deferDiagnostics = true;
// the following is for the benefit of JavacProcessingEnvironment.getContext()
@@ -904,8 +902,8 @@
JavaCompiler finalCompiler(boolean errorStatus) {
try {
JavaCompiler c = JavaCompiler.instance(nextContext());
+ c.log.nwarnings += compiler.log.nwarnings;
if (errorStatus) {
- c.log.nwarnings += priorWarnings + compiler.log.nwarnings;
c.log.nerrors += compiler.log.nerrors;
}
return c;