langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java
changeset 22163 3651128c74eb
parent 22150 af8945f58fc6
child 22165 ec53c8946fc2
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Dec 18 19:22:58 2013 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Dec 18 16:05:18 2013 -0500
@@ -181,8 +181,7 @@
  *  deletion without notice.</b>
  */
 public class Flow {
-    protected static final Context.Key<Flow> flowKey =
-        new Context.Key<Flow>();
+    protected static final Context.Key<Flow> flowKey = new Context.Key<>();
 
     private final Names names;
     private final Log log;
@@ -373,7 +372,7 @@
 
         /** Resolve all continues of this statement. */
         boolean resolveContinues(JCTree tree) {
-            return resolveJump(tree, new ListBuffer<P>(), JumpKind.CONTINUE);
+            return resolveJump(tree, new ListBuffer<>(), JumpKind.CONTINUE);
         }
 
         /** Resolve all breaks of this statement. */
@@ -449,7 +448,7 @@
             ListBuffer<PendingExit> pendingExitsPrev = pendingExits;
             Lint lintPrev = lint;
 
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             lint = lint.augment(tree.sym);
 
             try {
@@ -498,7 +497,7 @@
                     log.error(TreeInfo.diagEndPos(tree.body), "missing.ret.stmt");
 
                 List<PendingExit> exits = pendingExits.toList();
-                pendingExits = new ListBuffer<PendingExit>();
+                pendingExits = new ListBuffer<>();
                 while (exits.nonEmpty()) {
                     PendingExit exit = exits.head;
                     exits = exits.tail;
@@ -527,7 +526,7 @@
 
         public void visitDoLoop(JCDoWhileLoop tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             scanStat(tree.body);
             alive |= resolveContinues(tree);
             scan(tree.cond);
@@ -537,7 +536,7 @@
 
         public void visitWhileLoop(JCWhileLoop tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.cond);
             alive = !tree.cond.type.isFalse();
             scanStat(tree.body);
@@ -549,7 +548,7 @@
         public void visitForLoop(JCForLoop tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
             scanStats(tree.init);
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             if (tree.cond != null) {
                 scan(tree.cond);
                 alive = !tree.cond.type.isFalse();
@@ -567,7 +566,7 @@
             visitVarDef(tree.var);
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
             scan(tree.expr);
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             scanStat(tree.body);
             alive |= resolveContinues(tree);
             resolveBreaks(tree, prevPendingExits);
@@ -576,14 +575,14 @@
 
         public void visitLabelled(JCLabeledStatement tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             scanStat(tree.body);
             alive |= resolveBreaks(tree, prevPendingExits);
         }
 
         public void visitSwitch(JCSwitch tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.selector);
             boolean hasDefault = false;
             for (List<JCCase> l = tree.cases; l.nonEmpty(); l = l.tail) {
@@ -610,7 +609,7 @@
 
         public void visitTry(JCTry tree) {
             ListBuffer<PendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<PendingExit>();
+            pendingExits = new ListBuffer<>();
             for (JCTree resource : tree.resources) {
                 if (resource instanceof JCVariableDecl) {
                     JCVariableDecl vdecl = (JCVariableDecl) resource;
@@ -741,7 +740,7 @@
             try {
                 attrEnv = env;
                 Flow.this.make = make;
-                pendingExits = new ListBuffer<PendingExit>();
+                pendingExits = new ListBuffer<>();
                 alive = true;
                 scan(tree);
             } finally {
@@ -846,7 +845,7 @@
             ListBuffer<FlowPendingExit> pendingExitsPrev = pendingExits;
             Lint lintPrev = lint;
 
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             if (tree.name != names.empty) {
                 caught = List.nil();
             }
@@ -951,7 +950,7 @@
                 scan(tree.body);
 
                 List<FlowPendingExit> exits = pendingExits.toList();
-                pendingExits = new ListBuffer<FlowPendingExit>();
+                pendingExits = new ListBuffer<>();
                 while (exits.nonEmpty()) {
                     FlowPendingExit exit = exits.head;
                     exits = exits.tail;
@@ -986,7 +985,7 @@
 
         public void visitDoLoop(JCDoWhileLoop tree) {
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.body);
             resolveContinues(tree);
             scan(tree.cond);
@@ -995,7 +994,7 @@
 
         public void visitWhileLoop(JCWhileLoop tree) {
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.cond);
             scan(tree.body);
             resolveContinues(tree);
@@ -1005,7 +1004,7 @@
         public void visitForLoop(JCForLoop tree) {
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
             scan(tree.init);
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             if (tree.cond != null) {
                 scan(tree.cond);
             }
@@ -1019,7 +1018,7 @@
             visitVarDef(tree.var);
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
             scan(tree.expr);
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.body);
             resolveContinues(tree);
             resolveBreaks(tree, prevPendingExits);
@@ -1027,14 +1026,14 @@
 
         public void visitLabelled(JCLabeledStatement tree) {
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.body);
             resolveBreaks(tree, prevPendingExits);
         }
 
         public void visitSwitch(JCSwitch tree) {
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             scan(tree.selector);
             for (List<JCCase> l = tree.cases; l.nonEmpty(); l = l.tail) {
                 JCCase c = l.head;
@@ -1060,7 +1059,7 @@
             }
 
             ListBuffer<FlowPendingExit> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<FlowPendingExit>();
+            pendingExits = new ListBuffer<>();
             for (JCTree resource : tree.resources) {
                 if (resource instanceof JCVariableDecl) {
                     JCVariableDecl vdecl = (JCVariableDecl) resource;
@@ -1270,7 +1269,7 @@
                 thrown = List.nil();
                 scan(tree.body);
                 List<FlowPendingExit> exits = pendingExits.toList();
-                pendingExits = new ListBuffer<FlowPendingExit>();
+                pendingExits = new ListBuffer<>();
                 while (exits.nonEmpty()) {
                     FlowPendingExit exit = exits.head;
                     exits = exits.tail;
@@ -1307,8 +1306,8 @@
             try {
                 attrEnv = env;
                 Flow.this.make = make;
-                pendingExits = new ListBuffer<FlowPendingExit>();
-                preciseRethrowTypes = new HashMap<Symbol, List<Type>>();
+                pendingExits = new ListBuffer<>();
+                preciseRethrowTypes = new HashMap<>();
                 this.thrown = this.caught = null;
                 this.classDef = null;
                 scan(tree);
@@ -1651,7 +1650,7 @@
             int nextadrPrev = nextadr;
             ListBuffer<P> pendingExitsPrev = pendingExits;
 
-            pendingExits = new ListBuffer<P>();
+            pendingExits = new ListBuffer<>();
             if (tree.name != names.empty) {
                 firstadr = nextadr;
             }
@@ -1826,7 +1825,7 @@
             flowKind = FlowKind.NORMAL;
             final Bits initsSkip = new Bits(true);
             final Bits uninitsSkip = new Bits(true);
-            pendingExits = new ListBuffer<P>();
+            pendingExits = new ListBuffer<>();
             int prevErrors = getLogNumberOfErrors();
             do {
                 final Bits uninitsEntry = new Bits(uninits);
@@ -1896,7 +1895,7 @@
             scan(tree.init);
             final Bits initsSkip = new Bits(true);
             final Bits uninitsSkip = new Bits(true);
-            pendingExits = new ListBuffer<P>();
+            pendingExits = new ListBuffer<>();
             int prevErrors = getLogNumberOfErrors();
             do {
                 final Bits uninitsEntry = new Bits(uninits);
@@ -1946,7 +1945,7 @@
             final Bits uninitsStart = new Bits(uninits);
 
             letInit(tree.pos(), tree.var.sym);
-            pendingExits = new ListBuffer<P>();
+            pendingExits = new ListBuffer<>();
             int prevErrors = getLogNumberOfErrors();
             do {
                 final Bits uninitsEntry = new Bits(uninits);
@@ -1969,7 +1968,7 @@
 
         public void visitLabelled(JCLabeledStatement tree) {
             ListBuffer<P> prevPendingExits = pendingExits;
-            pendingExits = new ListBuffer<P>();
+            pendingExits = new ListBuffer<>();
             scan(tree.body);
             resolveBreaks(tree, prevPendingExits);
         }
@@ -2219,7 +2218,7 @@
             ListBuffer<P> prevPending = pendingExits;
             try {
                 returnadr = nextadr;
-                pendingExits = new ListBuffer<P>();
+                pendingExits = new ListBuffer<>();
                 for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) {
                     JCVariableDecl def = l.head;
                     scan(def);
@@ -2676,7 +2675,7 @@
             try {
                 attrEnv = env;
                 Flow.this.make = make;
-                pendingExits = new ListBuffer<PendingExit>();
+                pendingExits = new ListBuffer<>();
                 scan(tree);
             } finally {
                 pendingExits = null;