equal
deleted
inserted
replaced
49 * This code and its internal interfaces are subject to change or |
49 * This code and its internal interfaces are subject to change or |
50 * deletion without notice.</b> |
50 * deletion without notice.</b> |
51 */ |
51 */ |
52 public class TransTypes extends TreeTranslator { |
52 public class TransTypes extends TreeTranslator { |
53 /** The context key for the TransTypes phase. */ |
53 /** The context key for the TransTypes phase. */ |
54 protected static final Context.Key<TransTypes> transTypesKey = |
54 protected static final Context.Key<TransTypes> transTypesKey = new Context.Key<>(); |
55 new Context.Key<TransTypes>(); |
|
56 |
55 |
57 /** Get the instance for this context. */ |
56 /** Get the instance for this context. */ |
58 public static TransTypes instance(Context context) { |
57 public static TransTypes instance(Context context) { |
59 TransTypes instance = context.get(transTypesKey); |
58 TransTypes instance = context.get(transTypesKey); |
60 if (instance == null) |
59 if (instance == null) |
86 compileStates = CompileStates.instance(context); |
85 compileStates = CompileStates.instance(context); |
87 names = Names.instance(context); |
86 names = Names.instance(context); |
88 log = Log.instance(context); |
87 log = Log.instance(context); |
89 syms = Symtab.instance(context); |
88 syms = Symtab.instance(context); |
90 enter = Enter.instance(context); |
89 enter = Enter.instance(context); |
91 overridden = new HashMap<MethodSymbol,MethodSymbol>(); |
90 overridden = new HashMap<>(); |
92 Source source = Source.instance(context); |
91 Source source = Source.instance(context); |
93 allowEnums = source.allowEnums(); |
92 allowEnums = source.allowEnums(); |
94 addBridges = source.addBridges(); |
93 addBridges = source.addBridges(); |
95 allowInterfaceBridges = source.allowDefaultMethods(); |
94 allowInterfaceBridges = source.allowDefaultMethods(); |
96 types = Types.instance(context); |
95 types = Types.instance(context); |
1002 JCClassDecl tree = (JCClassDecl) env.tree; |
1001 JCClassDecl tree = (JCClassDecl) env.tree; |
1003 tree.typarams = List.nil(); |
1002 tree.typarams = List.nil(); |
1004 super.visitClassDef(tree); |
1003 super.visitClassDef(tree); |
1005 make.at(tree.pos); |
1004 make.at(tree.pos); |
1006 if (addBridges) { |
1005 if (addBridges) { |
1007 ListBuffer<JCTree> bridges = new ListBuffer<JCTree>(); |
1006 ListBuffer<JCTree> bridges = new ListBuffer<>(); |
1008 if (false) //see CR: 6996415 |
1007 if (false) //see CR: 6996415 |
1009 bridges.appendList(addOverrideBridgesIfNeeded(tree, c)); |
1008 bridges.appendList(addOverrideBridgesIfNeeded(tree, c)); |
1010 if (allowInterfaceBridges || (tree.sym.flags() & INTERFACE) == 0) { |
1009 if (allowInterfaceBridges || (tree.sym.flags() & INTERFACE) == 0) { |
1011 addBridges(tree.pos(), c, bridges); |
1010 addBridges(tree.pos(), c, bridges); |
1012 } |
1011 } |