src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java

changeset 898
bf9f162c7104
parent 893
8f0dcb9499db
child 933
0f9e5b7f0d7e
     1.1 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Mon Feb 28 12:19:18 2011 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java	Mon Feb 28 13:37:48 2011 -0800
     1.3 @@ -807,8 +807,6 @@
     1.4          final JavaCompiler compiler;
     1.5          /** The log for the round. */
     1.6          final Log log;
     1.7 -        /** The number of warnings in the previous round. */
     1.8 -        final int priorWarnings;
     1.9  
    1.10          /** The ASTs to be compiled. */
    1.11          List<JCCompilationUnit> roots;
    1.12 @@ -826,10 +824,10 @@
    1.13          private Round(Context context, int number, int priorWarnings) {
    1.14              this.context = context;
    1.15              this.number = number;
    1.16 -            this.priorWarnings = priorWarnings;
    1.17  
    1.18              compiler = JavaCompiler.instance(context);
    1.19              log = Log.instance(context);
    1.20 +            log.nwarnings += priorWarnings;
    1.21              log.deferDiagnostics = true;
    1.22  
    1.23              // the following is for the benefit of JavacProcessingEnvironment.getContext()
    1.24 @@ -904,8 +902,8 @@
    1.25          JavaCompiler finalCompiler(boolean errorStatus) {
    1.26              try {
    1.27                  JavaCompiler c = JavaCompiler.instance(nextContext());
    1.28 +                c.log.nwarnings += compiler.log.nwarnings;
    1.29                  if (errorStatus) {
    1.30 -                    c.log.nwarnings += priorWarnings + compiler.log.nwarnings;
    1.31                      c.log.nerrors += compiler.log.nerrors;
    1.32                  }
    1.33                  return c;

mercurial