8014323: Add VariableTree.getNameExpression
authorjjg
Tue, 14 May 2013 21:08:40 -0700
changeset 17580 6696a7abec02
parent 17579 cd92ab6433e9
child 17581 69b191cb1d7e
8014323: Add VariableTree.getNameExpression Reviewed-by: darcy
langtools/src/share/classes/com/sun/source/tree/VariableTree.java
langtools/src/share/classes/com/sun/source/util/TreeScanner.java
langtools/test/tools/javac/tree/SourceTreeScannerTest.java
--- a/langtools/src/share/classes/com/sun/source/tree/VariableTree.java	Tue May 14 18:02:48 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/tree/VariableTree.java	Tue May 14 21:08:40 2013 -0700
@@ -33,6 +33,7 @@
  * For example:
  * <pre>
  *   <em>modifiers</em> <em>type</em> <em>name</em> <em>initializer</em> ;
+ *   <em>modifiers</em> <em>type</em> <em>qualified-name</em>.this
  * </pre>
  *
  * @jls sections 8.3 and 14.4
@@ -45,6 +46,7 @@
 public interface VariableTree extends StatementTree {
     ModifiersTree getModifiers();
     Name getName();
+    ExpressionTree getNameExpression();
     Tree getType();
     ExpressionTree getInitializer();
 }
--- a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java	Tue May 14 18:02:48 2013 -0700
+++ b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java	Tue May 14 21:08:40 2013 -0700
@@ -149,6 +149,7 @@
     public R visitVariable(VariableTree node, P p) {
         R r = scan(node.getModifiers(), p);
         r = scanAndReduce(node.getType(), p, r);
+        r = scanAndReduce(node.getNameExpression(), p, r);
         r = scanAndReduce(node.getInitializer(), p, r);
         return r;
     }
--- a/langtools/test/tools/javac/tree/SourceTreeScannerTest.java	Tue May 14 18:02:48 2013 -0700
+++ b/langtools/test/tools/javac/tree/SourceTreeScannerTest.java	Tue May 14 21:08:40 2013 -0700
@@ -36,7 +36,6 @@
 /*
  * @test
  * @bug 6923080
- * @ignore 8014323: Add VariableTree.getNameExpression
  * @summary TreeScanner.visitNewClass should scan tree.typeargs
  * @build AbstractTreeScannerTest SourceTreeScannerTest
  * @run main SourceTreeScannerTest -q -r .