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.

Bug 107583 - Step out throws ArrayIndexOutOfBoundsException
Summary: Step out throws ArrayIndexOutOfBoundsException
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 09:01 UTC by ehucka
Modified: 2007-09-26 09:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test source (7.74 KB, text/plain)
2007-06-21 09:02 UTC, ehucka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ehucka 2007-06-21 09:01:26 UTC
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)
Comment 1 ehucka 2007-06-21 09:02:16 UTC
Created attachment 44143 [details]
test source
Comment 2 Martin Entlicher 2007-06-21 11:31:42 UTC
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?
Comment 3 Jan Lahoda 2007-06-22 14:37:22 UTC
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)
Comment 4 Martin Entlicher 2007-06-25 17:56:14 UTC
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
Comment 5 Jan Lahoda 2007-06-29 14:47:52 UTC
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
Comment 6 ehucka 2007-07-10 09:58:51 UTC
verified