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 233526 - IndexOutOfBoundsException: end < start (16 < 31)
Summary: IndexOutOfBoundsException: end < start (16 < 31)
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-07-27 08:25 UTC by MackSix
Modified: 2013-07-30 02:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 202582


Attachments
stacktrace (2.20 KB, text/plain)
2013-07-27 08:25 UTC, MackSix
Details
stacktrace (2.20 KB, text/plain)
2013-07-27 09:12 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2013-07-27 08:25:09 UTC
Build: NetBeans IDE Dev (Build 201307262300)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.0-b53, Java(TM) SE Runtime Environment, 1.7.0_40-ea-b34
OS: Windows 7

User Comments:
MackSix: 1. Created custom Inspection per http://wiki.netbeans.org/TS_73_InspectAndRefactor
2. Tried to edit the custom inspection and typed $1 before first curly brace.
This Exception was thrown.




Stacktrace: 
java.lang.IndexOutOfBoundsException: end < start (16 < 31)
   at org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription(ErrorDescriptionFactory.java:217)
   at org.netbeans.modules.java.hints.declarative.idebinding.HintsTask$1.run(HintsTask.java:134)
   at org.netbeans.modules.java.hints.declarative.idebinding.HintsTask$1.run(HintsTask.java:123)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:493)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:593)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:155)
Comment 1 MackSix 2013-07-27 08:25:11 UTC
Created attachment 137885 [details]
stacktrace
Comment 2 MackSix 2013-07-27 08:39:43 UTC
1. Created custom Inspection per
http://wiki.netbeans.org/TS_73_InspectAndRefactor

Custom Inspection that works:

<!description="My Inspection">
{
    $1 $2;
    $2 = $3;
}=>
{
    $1 $2 = $3;
};;

2. Tried to edit and typed a "$4" in location shown below:

<!description="My Inspection">
{
   $1 $2;
   $2 = $3;

   $4
}=>
{
    $1 $2 = $3;
};;

This causes exception.
Comment 3 MackSix 2013-07-27 09:12:56 UTC
Created attachment 137887 [details]
stacktrace

1. Opened Inpect & Transform custom script in editor.
2. Tried editing it in editor.

This exception is thrown in editor too.
Comment 4 Jan Lahoda 2013-07-29 08:18:23 UTC
Fixed:
http://hg.netbeans.org/jet-main/rev/2fe25ab44dc7
Comment 5 Quality Engineering 2013-07-30 02:19:23 UTC
Integrated into 'main-silver', will be available in build *201307292300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2fe25ab44dc7
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #233526: some diagnostics need end pos table to get the end position - using the computed SourcePositions for that.