diff -r 3b3e23e67329 -r 3651128c74eb langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java --- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Wed Dec 18 19:22:58 2013 +0000 +++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Wed Dec 18 16:05:18 2013 -0500 @@ -201,7 +201,7 @@ } private Set initPlatformAnnotations() { - Set platformAnnotations = new HashSet(); + Set platformAnnotations = new HashSet<>(); platformAnnotations.add("java.lang.Deprecated"); platformAnnotations.add("java.lang.Override"); platformAnnotations.add("java.lang.SuppressWarnings"); @@ -374,7 +374,7 @@ try { loader.reload(); } catch(Exception e) { - ; // Ignore problems during a call to reload. + // Ignore problems during a call to reload. } } } @@ -450,7 +450,7 @@ private Map initProcessorOptions(Context context) { Options options = Options.instance(context); Set keySet = options.keySet(); - Map tempOptions = new LinkedHashMap(); + Map tempOptions = new LinkedHashMap<>(); for(String key : keySet) { if (key.startsWith("-A") && key.length() > 2) { @@ -473,7 +473,7 @@ } private Set initUnmatchedProcessorOptions() { - Set unmatchedProcessorOptions = new HashSet(); + Set unmatchedProcessorOptions = new HashSet<>(); unmatchedProcessorOptions.addAll(processorOptions.keySet()); return unmatchedProcessorOptions; } @@ -501,14 +501,14 @@ checkSourceVersionCompatibility(source, log); - supportedAnnotationPatterns = new ArrayList(); + supportedAnnotationPatterns = new ArrayList<>(); for (String importString : processor.getSupportedAnnotationTypes()) { supportedAnnotationPatterns.add(importStringToPattern(importString, processor, log)); } - supportedOptionNames = new ArrayList(); + supportedOptionNames = new ArrayList<>(); for (String optionName : processor.getSupportedOptions() ) { if (checkOptionName(optionName, log)) supportedOptionNames.add(optionName); @@ -639,7 +639,7 @@ DiscoveredProcessors(Iterator processorIterator) { this.processorIterator = processorIterator; - this.procStateList = new ArrayList(); + this.procStateList = new ArrayList<>(); } /** @@ -657,8 +657,7 @@ Set annotationsPresent, List topLevelClasses, List packageInfoFiles) { - Map unmatchedAnnotations = - new HashMap(annotationsPresent.size()); + Map unmatchedAnnotations = new HashMap<>(annotationsPresent.size()); for(TypeElement a : annotationsPresent) { unmatchedAnnotations.put(a.getQualifiedName().toString(), @@ -676,7 +675,7 @@ // were parse errors on the initial source files; however, we // are not doing processing in that case. - Set rootElements = new LinkedHashSet(); + Set rootElements = new LinkedHashSet<>(); rootElements.addAll(topLevelClasses); rootElements.addAll(packageInfoFiles); rootElements = Collections.unmodifiableSet(rootElements); @@ -688,8 +687,8 @@ while(unmatchedAnnotations.size() > 0 && psi.hasNext() ) { ProcessorState ps = psi.next(); - Set matchedNames = new HashSet(); - Set typeElements = new LinkedHashSet(); + Set matchedNames = new HashSet<>(); + Set typeElements = new LinkedHashSet<>(); for (Map.Entry entry: unmatchedAnnotations.entrySet()) { String unmatchedAnnotationName = entry.getKey(); @@ -864,7 +863,7 @@ Log.DeferredDiagnosticHandler deferredDiagnosticHandler) { this(context, 1, 0, 0, deferredDiagnosticHandler); this.roots = roots; - genClassFiles = new HashMap(); + genClassFiles = new HashMap<>(); compiler.todo.clear(); // free the compiler's resources @@ -976,7 +975,7 @@ void findAnnotationsPresent() { ComputeAnnotationSet annotationComputer = new ComputeAnnotationSet(elementUtils); // Use annotation processing to compute the set of annotations present - annotationsPresent = new LinkedHashSet(); + annotationsPresent = new LinkedHashSet<>(); for (ClassSymbol classSym : topLevelClasses) annotationComputer.scan(classSym, annotationsPresent); for (PackageSymbol pkgSym : packageInfoFiles) @@ -1162,7 +1161,7 @@ Log.DeferredDiagnosticHandler deferredDiagnosticHandler) { log = Log.instance(context); - Set specifiedPackages = new LinkedHashSet(); + Set specifiedPackages = new LinkedHashSet<>(); for (PackageSymbol psym : pckSymbols) specifiedPackages.add(psym); this.specifiedPackages = Collections.unmodifiableSet(specifiedPackages); @@ -1185,8 +1184,8 @@ // Set up next round. // Copy mutable collections returned from filer. round = round.next( - new LinkedHashSet(filer.getGeneratedSourceFileObjects()), - new LinkedHashMap(filer.getGeneratedClasses())); + new LinkedHashSet<>(filer.getGeneratedSourceFileObjects()), + new LinkedHashMap<>(filer.getGeneratedClasses())); // Check for errors during setup. if (round.unrecoverableError()) @@ -1217,7 +1216,7 @@ errorStatus = true; Set newSourceFiles = - new LinkedHashSet(filer.getGeneratedSourceFileObjects()); + new LinkedHashSet<>(filer.getGeneratedSourceFileObjects()); roots = cleanTrees(round.roots); JavaCompiler compiler = round.finalCompiler();