< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java

Print this page
*** 649,10 ***
--- 649,15 ---
       */
      public static int getEndPos(JCTree tree, EndPosTable endPosTable) {
          if (tree == null)
              return Position.NOPOS;
  
+         if (endPosTable == null) {
+             // fall back on limited info in the tree
+             return endPos(tree);
+         }
+ 
          int mapPos = endPosTable.getEndPos(tree);
          if (mapPos != Position.NOPOS)
              return mapPos;
  
          switch(tree.getTag()) {
< prev index next >