src/share/classes/com/sun/tools/javac/comp/Attr.java

changeset 2047
5f915a0c9615
parent 2028
4ce8148ffc4f
child 2049
64e79d38bd07
     1.1 --- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Sep 23 10:10:07 2013 +0200
     1.2 +++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Sep 23 10:42:38 2013 +0200
     1.3 @@ -1724,7 +1724,7 @@
     1.4          boolean isConstructorCall =
     1.5              methName == names._this || methName == names._super;
     1.6  
     1.7 -        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
     1.8 +        ListBuffer<Type> argtypesBuf = new ListBuffer<>();
     1.9          if (isConstructorCall) {
    1.10              // We are seeing a ...this(...) or ...super(...) call.
    1.11              // Check that this is the first statement in a constructor.
    1.12 @@ -1989,7 +1989,7 @@
    1.13          }
    1.14  
    1.15          // Attribute constructor arguments.
    1.16 -        ListBuffer<Type> argtypesBuf = ListBuffer.lb();
    1.17 +        ListBuffer<Type> argtypesBuf = new ListBuffer<>();
    1.18          int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
    1.19          List<Type> argtypes = argtypesBuf.toList();
    1.20          List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
    1.21 @@ -2476,8 +2476,8 @@
    1.22              }
    1.23  
    1.24              private TypeSymbol makeNotionalInterface(IntersectionClassType ict) {
    1.25 -                ListBuffer<Type> targs = ListBuffer.lb();
    1.26 -                ListBuffer<Type> supertypes = ListBuffer.lb();
    1.27 +                ListBuffer<Type> targs = new ListBuffer<>();
    1.28 +                ListBuffer<Type> supertypes = new ListBuffer<>();
    1.29                  for (Type i : ict.interfaces_field) {
    1.30                      if (i.isParameterized()) {
    1.31                          targs.appendList(i.tsym.type.allparams());
    1.32 @@ -2907,7 +2907,7 @@
    1.33                  }
    1.34              });
    1.35          } else {
    1.36 -            ListBuffer<Type> targets = ListBuffer.lb();
    1.37 +            ListBuffer<Type> targets = new ListBuffer<>();
    1.38              if (pt.hasTag(CLASS)) {
    1.39                  if (pt.isCompound()) {
    1.40                      targets.append(types.removeWildcards(primaryTarget)); //this goes first
    1.41 @@ -3903,7 +3903,7 @@
    1.42      }
    1.43  
    1.44      public void visitTypeUnion(JCTypeUnion tree) {
    1.45 -        ListBuffer<Type> multicatchTypes = ListBuffer.lb();
    1.46 +        ListBuffer<Type> multicatchTypes = new ListBuffer<>();
    1.47          ListBuffer<Type> all_multicatchTypes = null; // lazy, only if needed
    1.48          for (JCExpression typeTree : tree.alternatives) {
    1.49              Type ctype = attribType(typeTree, env);
    1.50 @@ -3930,7 +3930,7 @@
    1.51                      all_multicatchTypes.append(ctype);
    1.52              } else {
    1.53                  if (all_multicatchTypes == null) {
    1.54 -                    all_multicatchTypes = ListBuffer.lb();
    1.55 +                    all_multicatchTypes = new ListBuffer<>();
    1.56                      all_multicatchTypes.appendList(multicatchTypes);
    1.57                  }
    1.58                  all_multicatchTypes.append(ctype);
    1.59 @@ -4085,7 +4085,7 @@
    1.60          if (annotations.isEmpty())
    1.61              return List.nil();
    1.62  
    1.63 -        ListBuffer<Attribute.TypeCompound> buf = ListBuffer.lb();
    1.64 +        ListBuffer<Attribute.TypeCompound> buf = new ListBuffer<>();
    1.65          for (JCAnnotation anno : annotations) {
    1.66              if (anno.attribute != null) {
    1.67                  // TODO: this null-check is only needed for an obscure

mercurial