--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java Thu Nov 01 12:47:11 2012 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java Thu Nov 01 13:06:43 2012 +0000
@@ -503,6 +503,14 @@
result = sr;
}
+ @Override
+ public void visitLetExpr(LetExpr tree) {
+ SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
+ sr.mergeWith(csp(tree.defs));
+ sr.mergeWith(csp(tree.expr));
+ result = sr;
+ }
+
public void visitTypeParameter(JCTypeParameter tree) {
SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
sr.mergeWith(csp(tree.bounds));
@@ -525,7 +533,7 @@
*/
public int startPos(JCTree tree) {
if (tree == null) return Position.NOPOS;
- return tree.pos;
+ return TreeInfo.getStartPos(tree);
}
/** The end position of given tree, if it has
@@ -533,9 +541,7 @@
*/
public int endPos(JCTree tree) {
if (tree == null) return Position.NOPOS;
- if (tree.hasTag(JCTree.Tag.BLOCK))
- return ((JCBlock) tree).endpos;
- return endPosTable.getEndPos(tree);
+ return TreeInfo.getEndPos(tree, endPosTable);
}
}