langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java
changeset 22163 3651128c74eb
parent 22154 3c8d86bf756b
child 24069 dfb8f11542fc
--- 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<TreeMaker> treeMakerKey =
-        new Context.Key<TreeMaker>();
+    protected static final Context.Key<TreeMaker> 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<JCExpression> Idents(List<JCVariableDecl> params) {
-        ListBuffer<JCExpression> ids = new ListBuffer<JCExpression>();
+        ListBuffer<JCExpression> ids = new ListBuffer<>();
         for (List<JCVariableDecl> 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<JCExpression> Types(List<Type> ts) {
-        ListBuffer<JCExpression> lb = new ListBuffer<JCExpression>();
+        ListBuffer<JCExpression> lb = new ListBuffer<>();
         for (List<Type> l = ts; l.nonEmpty(); l = l.tail)
             lb.append(Type(l.head));
         return lb.toList();
@@ -733,7 +732,7 @@
      */
     public List<JCAnnotation> Annotations(List<Attribute.Compound> attributes) {
         if (attributes == null) return List.nil();
-        ListBuffer<JCAnnotation> result = new ListBuffer<JCAnnotation>();
+        ListBuffer<JCAnnotation> result = new ListBuffer<>();
         for (List<Attribute.Compound> 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<JCExpression> args = new ListBuffer<JCExpression>();
+            ListBuffer<JCExpression> args = new ListBuffer<>();
             for (List<Pair<Symbol.MethodSymbol,Attribute>> values = compound.values; values.nonEmpty(); values=values.tail) {
                 Pair<MethodSymbol,Attribute> 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<JCExpression> args = new ListBuffer<JCExpression>();
+            ListBuffer<JCExpression> args = new ListBuffer<>();
             for (List<Pair<Symbol.MethodSymbol,Attribute>> values = compound.values; values.nonEmpty(); values=values.tail) {
                 Pair<MethodSymbol,Attribute> 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<JCExpression> elems = new ListBuffer<JCExpression>();
+            ListBuffer<JCExpression> elems = new ListBuffer<>();
             for (int i = 0; i < array.values.length; i++)
                 elems.append(translate(array.values[i]));
             result = NewArray(null, List.<JCExpression>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<JCTypeParameter> TypeParams(List<Type> typarams) {
-        ListBuffer<JCTypeParameter> tparams = new ListBuffer<JCTypeParameter>();
+        ListBuffer<JCTypeParameter> tparams = new ListBuffer<>();
         for (List<Type> 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<JCVariableDecl> Params(List<Type> argtypes, Symbol owner) {
-        ListBuffer<JCVariableDecl> params = new ListBuffer<JCVariableDecl>();
+        ListBuffer<JCVariableDecl> 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)