src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java

Print this page

        

*** 29,38 **** --- 29,40 ---- import java.lang.annotation.*; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.util.LinkedHashMap; import java.util.Map; + import java.io.ObjectInputStream; + import java.io.IOException; import sun.reflect.annotation.*; import javax.lang.model.type.TypeMirror; import javax.lang.model.type.MirroredTypeException; import javax.lang.model.type.MirroredTypesException;
*** 266,279 **** /** * ExceptionProxy for MirroredTypeException. * The toString, hashCode, and equals methods foward to the underlying * type. */ ! private static class MirroredTypeExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; ! private transient final TypeMirror type; private final String typeString; MirroredTypeExceptionProxy(TypeMirror t) { type = t; typeString = t.toString(); --- 268,281 ---- /** * ExceptionProxy for MirroredTypeException. * The toString, hashCode, and equals methods foward to the underlying * type. */ ! private static final class MirroredTypeExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; ! private transient TypeMirror type; private final String typeString; MirroredTypeExceptionProxy(TypeMirror t) { type = t; typeString = t.toString();
*** 294,315 **** } protected RuntimeException generateException() { return new MirroredTypeException(type); } } /** * ExceptionProxy for MirroredTypesException. * The toString, hashCode, and equals methods foward to the underlying * types. */ ! private static class MirroredTypesExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; ! private transient final List<TypeMirror> types; private final String typeStrings; MirroredTypesExceptionProxy(List<TypeMirror> ts) { types = ts; typeStrings = ts.toString(); --- 296,324 ---- } protected RuntimeException generateException() { return new MirroredTypeException(type); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + type = null; + } } /** * ExceptionProxy for MirroredTypesException. * The toString, hashCode, and equals methods foward to the underlying * types. */ ! private static final class MirroredTypesExceptionProxy extends ExceptionProxy { static final long serialVersionUID = 269; ! private transient List<TypeMirror> types; private final String typeStrings; MirroredTypesExceptionProxy(List<TypeMirror> ts) { types = ts; typeStrings = ts.toString();
*** 331,337 **** --- 340,353 ---- } protected RuntimeException generateException() { return new MirroredTypesException(types); } + + // Explicitly set all transient fields. + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException { + s.defaultReadObject(); + types = null; + } } }