530 /** The end position of given tree, if it has |
530 /** The end position of given tree, if it has |
531 * defined endpos, NOPOS otherwise. |
531 * defined endpos, NOPOS otherwise. |
532 */ |
532 */ |
533 public int endPos(JCTree tree) { |
533 public int endPos(JCTree tree) { |
534 if (tree == null) return Position.NOPOS; |
534 if (tree == null) return Position.NOPOS; |
535 if (tree.getTag() == JCTree.BLOCK) |
535 if (tree.hasTag(JCTree.Tag.BLOCK)) |
536 return ((JCBlock) tree).endpos; |
536 return ((JCBlock) tree).endpos; |
537 Integer endpos = endPositions.get(tree); |
537 Integer endpos = endPositions.get(tree); |
538 if (endpos != null) |
538 if (endpos != null) |
539 return endpos.intValue(); |
539 return endpos.intValue(); |
540 return Position.NOPOS; |
540 return Position.NOPOS; |