--- old/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java 2015-02-23 20:10:47.000000000 +0100 +++ new/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransTypes.java 2015-02-23 20:10:47.000000000 +0100 @@ -28,6 +28,7 @@ import java.util.*; import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Attribute.TypeCompound; import com.sun.tools.javac.code.Symbol.*; import com.sun.tools.javac.tree.*; import com.sun.tools.javac.tree.JCTree.*; @@ -68,6 +69,7 @@ private TreeMaker make; private Enter enter; private Types types; + private Annotate annotate; private final Resolve resolve; private final CompileStates compileStates; @@ -91,6 +93,7 @@ Source source = Source.instance(context); allowInterfaceBridges = source.allowDefaultMethods(); allowGraphInference = source.allowGraphInference(); + annotate = Annotate.instance(context); } /** A hashtable mapping bridge methods to the methods they override after @@ -751,6 +754,15 @@ result = tree; } + public void visitAnnotatedType(JCAnnotatedType tree) { + // For now, we need to keep the annotations in the tree because of the current + // MultiCatch implementation wrt type annotations + List mirrors = annotate.fromAnnotations(tree.annotations); + tree.underlyingType = translate(tree.underlyingType); + tree.type = tree.underlyingType.type.annotatedType(mirrors); + result = tree; + } + public void visitTypeCast(JCTypeCast tree) { tree.clazz = translate(tree.clazz, null); Type originalTarget = tree.type;