This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 070621) Java: 1.6.0_02; Java HotSpot(TM) Client VM 1.6.0_02-b04 System: Linux version 2.6.16-1.2122_FC5 running on i386; UTF-8; en_US (nb) Test case: 1. open the attached source file 2. place breakpoint on line 58 3. start debugging 4. after the breakpoint is hit invoke step into and step out Result: application is not stopped, exception is thrown java.lang.ArrayIndexOutOfBoundsException: -1 at com.sun.tools.javac.util.Position$LineTabMapImpl.getColumnNumber(Position.java:244) at com.sun.tools.javac.util.Position$LineMapImpl.getColumnNumber(Position.java:214) at org.netbeans.modules.debugger.jpda.projects.AST2Bytecode.matchSourceTree2Bytecode(AST2Bytecode.java:126) at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl$8.run(EditorContextImpl.java:986) at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl$8.run(EditorContextImpl.java:951) at org.netbeans.api.java.source.JavaSource.runUserActionTask(JavaSource.java:564) at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getOperations(EditorContextImpl.java:948) at org.netbeans.modules.debugger.jpda.EditorContextBridge.getOperations(EditorContextBridge.java:252) at org.netbeans.modules.debugger.jpda.ExpressionPool.createExpressionAt(ExpressionPool.java:136) at org.netbeans.modules.debugger.jpda.ExpressionPool.getExpressionAt(ExpressionPool.java:65) at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:316) at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.exec(StepActionProvider.java:233) [catch] at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:235) at java.lang.Thread.run(Thread.java:619)
Created attachment 44143 [details] test source
This looks like a bug in com.sun.tools.javac.api.JavacTrees. The problem is, that SourcePositions.getStartPosition(CompilationUnitTree, Tree) returns 1918, but SourcePositions.getEndPosition(CompilationUnitTree, Tree) returns -1. This is a bug, right?
I tested this, and the tree for which the positions are returned is the synthetic "super();" constructor call (which is not part of the source code, but is in the tree). Sorry, but you will need to check for it somehow: -using TreeUtilities.isSynthetic (TreePath is currently needed for this method, a method taking only Tree may be introduced later) -check for -1 positions (to that reliable, but you do not need TreePath)
It looks like TreeUtilities.isSynthetic() does not work then. I've added condition for: ci.getTreeUtilities().isSynthetic(ci.getTrees().getPath(cu, node)) But it returns false for super(); TreeUtilities.isSynthetic() does not count with METHOD_INVOCATION kind. /shared/data/ccvs/repository/debuggerjpda/projects/src/org/netbeans/modules/debugger/jpda/projects/AST2Bytecode.java,v <-- AST2Bytecode.java new revision: 1.4; previous revision: 1.3
Checking in TreeUtilities.java; /cvs/java/source/src/org/netbeans/api/java/source/TreeUtilities.java,v <-- TreeUtilities.java new revision: 1.26; previous revision: 1.25 done
verified