langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
changeset 22163 3651128c74eb
parent 21498 58c2486db8d0
child 22442 8fd30fc4e3a3
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Dec 18 19:22:58 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Dec 18 16:05:18 2013 -0500
@@ -62,8 +62,7 @@
  *  deletion without notice.</b>
  */
 public class MemberEnter extends JCTree.Visitor implements Completer {
-    protected static final Context.Key<MemberEnter> memberEnterKey =
-        new Context.Key<MemberEnter>();
+    protected static final Context.Key<MemberEnter> memberEnterKey = new Context.Key<>();
 
     /** A switch to determine whether we check for package/class conflicts
      */
@@ -126,7 +125,7 @@
     /** A queue for classes whose members still need to be entered into the
      *  symbol table.
      */
-    ListBuffer<Env<AttrContext>> halfcompleted = new ListBuffer<Env<AttrContext>>();
+    ListBuffer<Env<AttrContext>> halfcompleted = new ListBuffer<>();
 
     /** Set to true only when the first of a set of classes is
      *  processed from the half completed queue.
@@ -178,7 +177,7 @@
 
         // enter imported types immediately
         new Object() {
-            Set<Symbol> processed = new HashSet<Symbol>();
+            Set<Symbol> processed = new HashSet<>();
             void importFrom(TypeSymbol tsym) {
                 if (tsym == null || !processed.add(tsym))
                     return;
@@ -203,7 +202,7 @@
 
         // enter non-types before annotations that might use them
         annotate.earlier(new Annotate.Worker() {
-            Set<Symbol> processed = new HashSet<Symbol>();
+            Set<Symbol> processed = new HashSet<>();
 
             public String toString() {
                 return "import static " + tsym + ".*" + " in " + sourcefile;
@@ -271,7 +270,7 @@
 
         // enter imported types immediately
         new Object() {
-            Set<Symbol> processed = new HashSet<Symbol>();
+            Set<Symbol> processed = new HashSet<>();
             void importFrom(TypeSymbol tsym) {
                 if (tsym == null || !processed.add(tsym))
                     return;
@@ -297,7 +296,7 @@
 
         // enter non-types before annotations that might use them
         annotate.earlier(new Annotate.Worker() {
-            Set<Symbol> processed = new HashSet<Symbol>();
+            Set<Symbol> processed = new HashSet<>();
             boolean found = false;
 
             public String toString() {
@@ -378,7 +377,7 @@
         attr.attribTypeVariables(typarams, env);
 
         // Enter and attribute value parameters.
-        ListBuffer<Type> argbuf = new ListBuffer<Type>();
+        ListBuffer<Type> argbuf = new ListBuffer<>();
         for (List<JCVariableDecl> l = params; l.nonEmpty(); l = l.tail) {
             memberEnter(l.head, env);
             argbuf.append(l.head.vartype.type);
@@ -397,7 +396,7 @@
         }
 
         // Attribute thrown exceptions.
-        ListBuffer<Type> thrownbuf = new ListBuffer<Type>();
+        ListBuffer<Type> thrownbuf = new ListBuffer<>();
         for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail) {
             Type exc = attr.attribType(l.head, env);
             if (!exc.hasTag(TYPEVAR)) {
@@ -591,7 +590,7 @@
             }
 
             // Set m.params
-            ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>();
+            ListBuffer<VarSymbol> params = new ListBuffer<>();
             JCVariableDecl lastParam = null;
             for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
                 JCVariableDecl param = lastParam = l.head;
@@ -915,10 +914,8 @@
     private void actualEnterAnnotations(List<JCAnnotation> annotations,
                           Env<AttrContext> env,
                           Symbol s) {
-        Map<TypeSymbol, ListBuffer<Attribute.Compound>> annotated =
-                new LinkedHashMap<TypeSymbol, ListBuffer<Attribute.Compound>>();
-        Map<Attribute.Compound, DiagnosticPosition> pos =
-                new HashMap<Attribute.Compound, DiagnosticPosition>();
+        Map<TypeSymbol, ListBuffer<Attribute.Compound>> annotated = new LinkedHashMap<>();
+        Map<Attribute.Compound, DiagnosticPosition> pos = new HashMap<>();
 
         for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
             JCAnnotation a = al.head;
@@ -952,7 +949,7 @@
         }
 
         s.setDeclarationAttributesWithCompletion(
-                annotate.new AnnotateRepeatedContext<Attribute.Compound>(env, annotated, pos, log, false));
+                annotate.new AnnotateRepeatedContext<>(env, annotated, pos, log, false));
     }
 
     /** Queue processing of an attribute default value. */
@@ -1064,9 +1061,9 @@
             ct.supertype_field = modelMissingTypes(supertype, tree.extending, false);
 
             // Determine interfaces.
-            ListBuffer<Type> interfaces = new ListBuffer<Type>();
+            ListBuffer<Type> interfaces = new ListBuffer<>();
             ListBuffer<Type> all_interfaces = null; // lazy init
-            Set<Type> interfaceSet = new HashSet<Type>();
+            Set<Type> interfaceSet = new HashSet<>();
             List<JCExpression> interfaceTrees = tree.implementing;
             for (JCExpression iface : interfaceTrees) {
                 Type i = attr.attribBase(iface, baseEnv, false, true, true);
@@ -1214,10 +1211,8 @@
     private void actualEnterTypeAnnotations(final List<JCAnnotation> annotations,
             final Env<AttrContext> env,
             final Symbol s) {
-        Map<TypeSymbol, ListBuffer<Attribute.TypeCompound>> annotated =
-                new LinkedHashMap<TypeSymbol, ListBuffer<Attribute.TypeCompound>>();
-        Map<Attribute.TypeCompound, DiagnosticPosition> pos =
-                new HashMap<Attribute.TypeCompound, DiagnosticPosition>();
+        Map<TypeSymbol, ListBuffer<Attribute.TypeCompound>> annotated = new LinkedHashMap<>();
+        Map<Attribute.TypeCompound, DiagnosticPosition> pos = new HashMap<>();
 
         for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
             JCAnnotation a = al.head;
@@ -1245,7 +1240,7 @@
 
         if (s != null) {
             s.appendTypeAttributesWithCompletion(
-                    annotate.new AnnotateRepeatedContext<Attribute.TypeCompound>(env, annotated, pos, log, true));
+                    annotate.new AnnotateRepeatedContext<>(env, annotated, pos, log, true));
         }
     }
 
@@ -1448,7 +1443,7 @@
         }
 
         List<Type> visit(List<? extends JCTree> trees) {
-            ListBuffer<Type> lb = new ListBuffer<Type>();
+            ListBuffer<Type> lb = new ListBuffer<>();
             for (JCTree t: trees)
                 lb.append(visit(t));
             return lb.toList();