/** Create the compiler to be used for the final compilation. */ JavaCompiler finalCompiler(boolean errorStatus) { try { JavaCompiler c = JavaCompiler.instance(nextContext()); c.log.nwarnings += compiler.log.nwarnings; if (errorStatus) { c.log.nerrors += compiler.log.nerrors; } return c; } finally { compiler.close(false); } }
/** Create a round (common code). */ private Round(Context context, int number, int priorErrors, int priorWarnings) { this.context = context; this.number = number; compiler = JavaCompiler.instance(context); log = Log.instance(context); log.nerrors = priorErrors; log.nwarnings += priorWarnings; log.deferDiagnostics = true; // the following is for the benefit of JavacProcessingEnvironment.getContext() JavacProcessingEnvironment.this.context = context; // the following will be populated as needed topLevelClasses = List.nil(); packageInfoFiles = List.nil(); }