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 225977 - IndexOutOfBoundsException: end < start (23871 < 23889)
Summary: IndexOutOfBoundsException: end < start (23871 < 23889)
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 12:02 UTC by Jan Lahoda
Modified: 2013-02-13 12:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 198499


Attachments
stacktrace (2.33 KB, text/plain)
2013-02-11 12:02 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-02-11 12:02:28 UTC
Build: NetBeans IDE Dev (Build 20130208-73dc04f975fd)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_11-b21
OS: Linux

User Comments:
jlahoda: if (toSplit == null) {
            Tree right = ctx.getVariables().get("$secondCondition").getLeaf();
            long rightStart = ctx.getInfo().getTrees().getSourcePositions().getStartPosition(ctx.getPath().getCompilationUnit(), right);
            long rightEnd   = ctx.getInfo().getTrees().getSourcePositions().getEndPosition(ctx.getPath().getCompilationUnit(), right);

            if (rightStart <= caret && caret <= rightEnd) {
                toSplit = 
                continue;
            }
        }




Stacktrace: 
java.lang.IndexOutOfBoundsException: end < start (23871 < 23889)
   at org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription(ErrorDescriptionFactory.java:265)
   at org.netbeans.spi.java.hints.ErrorDescriptionFactory.forTree(ErrorDescriptionFactory.java:126)
   at org.netbeans.modules.java.hints.bugs.UnusedAssignmentOrBranch.unusedAssignment(UnusedAssignmentOrBranch.java:164)
   at sun.reflect.GeneratedMethodAccessor112.invoke(GeneratedMethodAccessor112.java:0)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
Comment 1 Jan Lahoda 2013-02-11 12:02:30 UTC
Created attachment 131236 [details]
stacktrace
Comment 2 Jan Lahoda 2013-02-11 13:30:57 UTC
http://hg.netbeans.org/jet-main/rev/f976888171ca
Comment 3 Quality Engineering 2013-02-13 12:24:11 UTC
Integrated into 'main-golden', will be available in build *201302130937* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f976888171ca
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #225977: fixing erroneous tree end position after partial reparse