changeset 3392:020899586e8b

8046296: java/util/concurrent/BlockingQueue/PollMemoryLeak.java fails in nightly on all platform due to compiler issue Summary: Alter logic to choose type of type annotation position for a variable declaration Reviewed-by: jjg
author emc
date Mon, 09 Jun 2014 15:46:44 -0400
parents a8ebc1d5cde9
children 3f12167b0a32 f7be68b3bd2e
files src/share/classes/com/sun/tools/javac/comp/Attr.java
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 09 12:54:02 2014 +0100
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Mon Jun 09 15:46:44 2014 -0400
@@ -1074,18 +1074,10 @@
                 return annotate.paramCreator(index);
             }
         }
-        case CASE:
-        case BLOCK:
-        case FORLOOP:
-        case FOREACHLOOP:
-        case LABELLED:
-            // These are all cases where we can end up with a
-            // local variable.
+        default:
+            // The default case is to treat any declaration as a local
+            // variable.
             return annotate.localVarCreator(tree.pos);
-        default:
-            // Be strict and throw an error if we see
-            // something we don't expect.
-            throw new AssertionError("Unexpected enclosing tree for variable definition: " + env.tree.getTag());
         }
     }