1.1 --- a/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Sun Oct 03 19:40:15 2010 +0100 1.2 +++ b/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Tue Oct 05 11:34:43 2010 -0700 1.3 @@ -173,12 +173,12 @@ 1.4 platformAnnotations = initPlatformAnnotations(); 1.5 foundTypeProcessors = false; 1.6 1.7 - // Initialize services before any processors are initialzied 1.8 + // Initialize services before any processors are initialized 1.9 // in case processors use them. 1.10 filer = new JavacFiler(context); 1.11 messager = new JavacMessager(context, this); 1.12 - elementUtils = new JavacElements(context); 1.13 - typeUtils = new JavacTypes(context); 1.14 + elementUtils = JavacElements.instance(context); 1.15 + typeUtils = JavacTypes.instance(context); 1.16 processorOptions = initProcessorOptions(context); 1.17 unmatchedProcessorOptions = initUnmatchedProcessorOptions(); 1.18 messages = JavacMessages.instance(context); 1.19 @@ -865,8 +865,6 @@ 1.20 this(prev.nextContext(), prev.number+1, prev.compiler.log.nwarnings); 1.21 this.genClassFiles = prev.genClassFiles; 1.22 1.23 - updateProcessingState(); 1.24 - 1.25 List<JCCompilationUnit> parsedFiles = compiler.parseFiles(newSourceFiles); 1.26 roots = cleanTrees(prev.roots).appendList(parsedFiles); 1.27 1.28 @@ -1029,15 +1027,6 @@ 1.29 log.reportDeferredDiagnostics(kinds); 1.30 } 1.31 1.32 - /** Update the processing state for the current context. */ 1.33 - private void updateProcessingState() { 1.34 - filer.newRound(context); 1.35 - messager.newRound(context); 1.36 - 1.37 - elementUtils.setContext(context); 1.38 - typeUtils.setContext(context); 1.39 - } 1.40 - 1.41 /** Print info about this round. */ 1.42 private void printRoundInfo(boolean lastRound) { 1.43 if (printRounds || verbose) { 1.44 @@ -1100,6 +1089,11 @@ 1.45 JavaCompiler nextCompiler = JavaCompiler.instance(next); 1.46 nextCompiler.initRound(oldCompiler); 1.47 1.48 + filer.newRound(next); 1.49 + messager.newRound(next); 1.50 + elementUtils.setContext(next); 1.51 + typeUtils.setContext(next); 1.52 + 1.53 JavacTaskImpl task = context.get(JavacTaskImpl.class); 1.54 if (task != null) { 1.55 next.put(JavacTaskImpl.class, task);