diff -r 3b3e23e67329 -r 3651128c74eb langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java --- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Wed Dec 18 19:22:58 2013 +0000 +++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java Wed Dec 18 16:05:18 2013 -0500 @@ -47,8 +47,7 @@ public class TreeMaker implements JCTree.Factory { /** The context key for the tree factory. */ - protected static final Context.Key treeMakerKey = - new Context.Key(); + protected static final Context.Key treeMakerKey = new Context.Key<>(); /** Get the TreeMaker instance. */ public static TreeMaker instance(Context context) { @@ -609,7 +608,7 @@ * in given list of variable declarations. */ public List Idents(List params) { - ListBuffer ids = new ListBuffer(); + ListBuffer ids = new ListBuffer<>(); for (List l = params; l.nonEmpty(); l = l.tail) ids.append(Ident(l.head)); return ids.toList(); @@ -710,7 +709,7 @@ /** Create a list of trees representing given list of types. */ public List Types(List ts) { - ListBuffer lb = new ListBuffer(); + ListBuffer lb = new ListBuffer<>(); for (List l = ts; l.nonEmpty(); l = l.tail) lb.append(Type(l.head)); return lb.toList(); @@ -733,7 +732,7 @@ */ public List Annotations(List attributes) { if (attributes == null) return List.nil(); - ListBuffer result = new ListBuffer(); + ListBuffer result = new ListBuffer<>(); for (List i = attributes; i.nonEmpty(); i=i.tail) { Attribute a = i.head; result.append(Annotation(a)); @@ -800,7 +799,7 @@ } } public JCAnnotation visitCompoundInternal(Attribute.Compound compound) { - ListBuffer args = new ListBuffer(); + ListBuffer args = new ListBuffer<>(); for (List> values = compound.values; values.nonEmpty(); values=values.tail) { Pair pair = values.head; JCExpression valueTree = translate(pair.snd); @@ -809,7 +808,7 @@ return Annotation(Type(compound.type), args.toList()); } public JCAnnotation visitTypeCompoundInternal(Attribute.TypeCompound compound) { - ListBuffer args = new ListBuffer(); + ListBuffer args = new ListBuffer<>(); for (List> values = compound.values; values.nonEmpty(); values=values.tail) { Pair pair = values.head; JCExpression valueTree = translate(pair.snd); @@ -818,7 +817,7 @@ return TypeAnnotation(Type(compound.type), args.toList()); } public void visitArray(Attribute.Array array) { - ListBuffer elems = new ListBuffer(); + ListBuffer elems = new ListBuffer<>(); for (int i = 0; i < array.values.length; i++) elems.append(translate(array.values[i])); result = NewArray(null, List.nil(), elems.toList()).setType(array.type); @@ -881,7 +880,7 @@ /** Create a list of type parameter trees from a list of type variables. */ public List TypeParams(List typarams) { - ListBuffer tparams = new ListBuffer(); + ListBuffer tparams = new ListBuffer<>(); for (List l = typarams; l.nonEmpty(); l = l.tail) tparams.append(TypeParam(l.head.tsym.name, (TypeVar)l.head)); return tparams.toList(); @@ -897,7 +896,7 @@ * their types and an their owner. */ public List Params(List argtypes, Symbol owner) { - ListBuffer params = new ListBuffer(); + ListBuffer params = new ListBuffer<>(); MethodSymbol mth = (owner.kind == MTH) ? ((MethodSymbol)owner) : null; if (mth != null && mth.params != null && argtypes.length() == mth.params.length()) { for (VarSymbol param : ((MethodSymbol)owner).params)