提交 4806b4fa 编写于 作者: V vromero

6983297: methods missing from NewArrayTree

Reviewed-by: jjg
上级 0c16e8c8
......@@ -25,7 +25,7 @@
package com.sun.source.tree;
import java.util.List;
import com.sun.tools.javac.util.List;
/**
* A tree node for an expression to create a new instance of an array.
......@@ -48,4 +48,6 @@ public interface NewArrayTree extends ExpressionTree {
Tree getType();
List<? extends ExpressionTree> getDimensions();
List<? extends ExpressionTree> getInitializers();
List<? extends AnnotationTree> getAnnotations();
List<? extends List<? extends AnnotationTree>> getDimAnnotations();
}
......@@ -285,6 +285,10 @@ public class TreeScanner<R,P> implements TreeVisitor<R,P> {
R r = scan(node.getType(), p);
r = scanAndReduce(node.getDimensions(), p, r);
r = scanAndReduce(node.getInitializers(), p, r);
r = scanAndReduce(node.getAnnotations(), p, r);
for (Iterable< ? extends Tree> dimAnno : node.getDimAnnotations()) {
r = scanAndReduce(dimAnno, p, r);
}
return r;
}
......
......@@ -1571,6 +1571,16 @@ public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
public Tag getTag() {
return NEWARRAY;
}
@Override
public List<JCAnnotation> getAnnotations() {
return annotations;
}
@Override
public List<List<JCAnnotation>> getDimAnnotations() {
return dimAnnotations;
}
}
/**
......
......@@ -140,13 +140,6 @@ public class SourceTreeScannerTest extends AbstractTreeScannerTest {
// not part of public API
continue;
}
if (JCTree.JCNewArray.class.isAssignableFrom(tree.getClass())
&& (f.getName().equals("annotations")
|| f.getName().equals("dimAnnotations"))) {
// these fields are incorrectly missing from the public API
// (CR 6983297)
continue;
}
try {
//System.err.println("FIELD: " + f.getName());
reflectiveScan(f.get(tree));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册