--- old/src/share/classes/com/sun/tools/apt/comp/Apt.java 2010-02-25 11:04:03.000000000 -0800 +++ new/src/share/classes/com/sun/tools/apt/comp/Apt.java 2010-02-25 11:04:03.000000000 -0800 @@ -457,8 +457,10 @@ throw new UsageMessageNeededException(); try { - for(AnnotationProcessorFactory apFactory: factoryToAnnotation.keySet()) { - AnnotationProcessor processor = apFactory.getProcessorFor(factoryToAnnotation.get(apFactory), + for(Map.Entry> entry : + factoryToAnnotation.entrySet()) { + AnnotationProcessorFactory apFactory = entry.getKey(); + AnnotationProcessor processor = apFactory.getProcessorFor(entry.getValue(), trivAPE); if (processor != null) processors.add(processor); --- old/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java 2010-02-25 11:04:04.000000000 -0800 +++ new/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java 2010-02-25 11:04:04.000000000 -0800 @@ -270,7 +270,7 @@ * The toString, hashCode, and equals methods foward to the underlying * type. */ - private static class MirroredTypeExceptionProxy extends ExceptionProxy { + private static final class MirroredTypeExceptionProxy extends ExceptionProxy { private static final long serialVersionUID = 6662035281599933545L; private MirroredTypeException ex; @@ -312,7 +312,7 @@ * The toString, hashCode, and equals methods foward to the underlying * types. */ - private static class MirroredTypesExceptionProxy extends ExceptionProxy { + private static final class MirroredTypesExceptionProxy extends ExceptionProxy { private static final long serialVersionUID = -6670822532616693951L; private MirroredTypesException ex; --- old/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java 2010-02-25 11:04:05.000000000 -0800 +++ new/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java 2010-02-25 11:04:05.000000000 -0800 @@ -58,7 +58,7 @@ protected final AptEnv env; public final Symbol sym; - protected static DeclarationFilter identityFilter = + protected static final DeclarationFilter identityFilter = new DeclarationFilter(); --- old/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java 2010-02-25 11:04:05.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java 2010-02-25 11:04:05.000000000 -0800 @@ -26,6 +26,8 @@ package com.sun.tools.javac.model; import com.sun.tools.javac.util.*; +import java.io.ObjectInputStream; +import java.io.IOException; import java.lang.annotation.*; import java.lang.reflect.Array; import java.lang.reflect.Method; @@ -268,10 +270,10 @@ * The toString, hashCode, and equals methods foward to the underlying * type. */ - private static class MirroredTypeExceptionProxy extends ExceptionProxy { + private static final class MirroredTypeExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; - private transient final TypeMirror type; + private transient TypeMirror type; private final String typeString; MirroredTypeExceptionProxy(TypeMirror t) { @@ -296,6 +298,13 @@ protected RuntimeException generateException() { return new MirroredTypeException(type); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + type = null; + } } @@ -304,10 +313,10 @@ * The toString, hashCode, and equals methods foward to the underlying * types. */ - private static class MirroredTypesExceptionProxy extends ExceptionProxy { + private static final class MirroredTypesExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; - private transient final List types; + private transient List types; private final String typeStrings; MirroredTypesExceptionProxy(List ts) { @@ -333,5 +342,12 @@ protected RuntimeException generateException() { return new MirroredTypesException(types); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + types = null; + } } } --- old/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-02-25 11:04:06.000000000 -0800 +++ new/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2010-02-25 11:04:05.000000000 -0800 @@ -690,10 +690,12 @@ ProcessorState ps = psi.next(); Set matchedNames = new HashSet(); Set typeElements = new LinkedHashSet(); - for (String unmatchedAnnotationName : unmatchedAnnotations.keySet()) { + + for (Map.Entry entry: unmatchedAnnotations.entrySet()) { + String unmatchedAnnotationName = entry.getKey(); if (ps.annotationSupported(unmatchedAnnotationName) ) { matchedNames.add(unmatchedAnnotationName); - TypeElement te = unmatchedAnnotations.get(unmatchedAnnotationName); + TypeElement te = entry.getValue(); if (te != null) typeElements.add(te); } @@ -790,7 +792,7 @@ List roots, List classSymbols, Iterable pckSymbols) - throws IOException { + throws IOException { log = Log.instance(context); // Writer for -XprintRounds and -XprintProcessorInfo data @@ -1218,7 +1220,7 @@ return false; } - private class AnnotationCollector extends TreeScanner { + private static class AnnotationCollector extends TreeScanner { List path = List.nil(); static final boolean verbose = false; List annotations = List.nil();