changeset 1756:529fb3ed5d2a

8014323: Add VariableTree.getNameExpression Reviewed-by: darcy
author jjg
date Tue, 14 May 2013 21:08:40 -0700
parents 53b389eb39c1
children bcd927639039
files src/share/classes/com/sun/source/tree/VariableTree.java src/share/classes/com/sun/source/util/TreeScanner.java test/tools/javac/tree/SourceTreeScannerTest.java
diffstat 3 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/source/tree/VariableTree.java	Tue May 14 18:02:48 2013 -0700
+++ b/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/src/share/classes/com/sun/source/util/TreeScanner.java	Tue May 14 18:02:48 2013 -0700
+++ b/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/test/tools/javac/tree/SourceTreeScannerTest.java	Tue May 14 18:02:48 2013 -0700
+++ b/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 .