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 113933 - IndexOutOfBoundsException: Illegal OffsetKind[offset=-1] in org.netbeans.modules.editor.java.JavaDocument
Summary: IndexOutOfBoundsException: Illegal OffsetKind[offset=-1] in org.netbeans.modu...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 113749 113940 114177 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-08-28 01:41 UTC by _ gtzabari
Modified: 2011-10-24 14:12 UTC (History)
14 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 1722


Attachments
stack-trace (6.07 KB, text/plain)
2007-08-28 01:42 UTC, _ gtzabari
Details
Source-code which triggers the exception (1.94 KB, text/plain)
2007-08-28 01:42 UTC, _ gtzabari
Details
stacktrace (6.46 KB, text/plain)
2007-08-28 01:55 UTC, _ gtzabari
Details
stacktrace (6.66 KB, text/plain)
2007-08-29 18:08 UTC, lstroud
Details
stacktrace (6.47 KB, text/plain)
2007-08-31 14:18 UTC, ukitzmann
Details
stacktrace (7.09 KB, text/plain)
2007-09-03 08:12 UTC, m1k0
Details
stacktrace (1014 bytes, text/plain)
2009-09-23 15:59 UTC, Michal Mocnak
Details
stacktrace (2.90 KB, text/plain)
2010-02-18 08:32 UTC, Michel Graciano
Details
stacktrace (2.91 KB, text/plain)
2010-02-18 08:33 UTC, Michel Graciano
Details
Sample class file which trigger the exception (8.80 KB, text/plain)
2010-02-18 08:36 UTC, Michel Graciano
Details
stacktrace (3.51 KB, text/plain)
2010-03-10 12:38 UTC, misterm
Details
stacktrace (3.51 KB, text/plain)
2010-03-10 12:39 UTC, misterm
Details
stacktrace (3.51 KB, text/plain)
2010-03-10 12:40 UTC, misterm
Details
stacktrace (5.70 KB, text/plain)
2010-04-20 15:13 UTC, Jesse Glick
Details
stacktrace (5.44 KB, text/plain)
2010-04-20 15:16 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2007-08-28 01:41:29 UTC
dev build 200708271200

When I open certain Java files the attached exception is thrown once every three seconds, rendering the editor totally
unusable. This seems to be dependent on the contents of the Java file but it is reproducible 100% of the time.
Comment 1 _ gtzabari 2007-08-28 01:42:23 UTC
Created attachment 47552 [details]
stack-trace
Comment 2 _ gtzabari 2007-08-28 01:42:47 UTC
Created attachment 47553 [details]
Source-code which triggers the exception
Comment 3 _ gtzabari 2007-08-28 01:53:29 UTC
*** Issue 113749 has been marked as a duplicate of this issue. ***
Comment 4 _ gtzabari 2007-08-28 01:55:19 UTC
Build: NetBeans IDE Dev (Build 200708271200)
VM: Java HotSpot(TM) Client VM, 1.7.0-ea-b18
OS: Windows XP, 5.1, x86
User Comments: 
Comment 5 _ gtzabari 2007-08-28 01:55:23 UTC
Created attachment 47557 [details]
stacktrace
Comment 6 Jiri Prox 2007-08-28 07:14:30 UTC
*** Issue 113940 has been marked as a duplicate of this issue. ***
Comment 7 Jan Lahoda 2007-08-28 09:52:24 UTC
Should be OK now:

Checking in src/org/netbeans/modules/java/hints/StaticAccess.java;
/cvs/java/hints/src/org/netbeans/modules/java/hints/StaticAccess.java,v  <--  StaticAccess.java
new revision: 1.11; previous revision: 1.10
done
Checking in test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java;
/cvs/java/hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/TreeRuleTestBase.java,v  <-- 
TreeRuleTestBase.java
new revision: 1.8; previous revision: 1.7
done
Comment 8 lstroud 2007-08-29 18:08:29 UTC
Build: NetBeans IDE Dev (Build 200708250000)
VM: Java HotSpot(TM) Client VM, 1.5.0_07-87
OS: Mac OS X, 10.4.10, i386

User Comments: 
typing in the damn editor :)... the ide seems to go crazy when I have a groovy file open for editing (no plugin)
Comment 9 lstroud 2007-08-29 18:08:32 UTC
Created attachment 47739 [details]
stacktrace
Comment 10 Jan Lahoda 2007-08-30 08:21:04 UTC
*** Issue 114177 has been marked as a duplicate of this issue. ***
Comment 11 ukitzmann 2007-08-31 14:17:55 UTC
Build: NetBeans IDE Dev (Build 200708280000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows Vista, 6.0, x86

User Comments: 
Comment 12 ukitzmann 2007-08-31 14:18:07 UTC
Created attachment 47883 [details]
stacktrace
Comment 13 m1k0 2007-09-03 08:12:15 UTC
Build: NetBeans IDE Dev (Build 200708270000)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Linux, 2.6.20-gentoo-r6, i386

User Comments: 
Comment 14 m1k0 2007-09-03 08:12:20 UTC
Created attachment 47947 [details]
stacktrace
Comment 15 Exceptions Reporter 2008-10-08 14:41:21 UTC
Reopening - reproduced in NetBeans IDE Dev (Build 200809281401)
http://statistics.netbeans.org/exceptions/detail.do?id=124888
Comment 17 Quality Engineering 2008-10-09 05:47:30 UTC
Integrated into 'main-golden', will be available in build *200810090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/359277a61c8c
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #113933: correct translation of offsets.
Comment 18 kurti 2009-09-06 14:43:41 UTC
This issue is marked as the fix for there stacktraces:

http://statistics.netbeans.org/analytics/detail.do?id=1722

but these traces still appear, so either the fix did not fix everything or the stacktraces are assigned the wrong issue.
Comment 19 Jan Lahoda 2009-09-09 12:35:14 UTC
The exception reporter should have create a new issue, as the important part of the new exceptions are different that
the original ones:
java.lang.IndexOutOfBoundsException: Illegal OffsetKind[offset=-1] in
org.netbeans.modules.editor.NbEditorDocument@1672664, mimeType = 'text/x-jsp', kitClass = null, length = 1640,
file=org.netbeans.modules.web.core.jsploader.JspDataObject@18b3e8b[/home/kiroffbg/Projects/webdine/trunk/web/pages/setup/loyalty/main.jsp]
used by org.netbeans.modules.web.core.jsploader.BaseJspEditorSupport@1768f6e.
        at org.openide.text.PositionRef$Manager$OffsetKind.(PositionRef.java:657)
        at org.openide.text.PositionRef.(PositionRef.java:84)
        at org.openide.text.CloneableEditorSupport.createPositionRef(CloneableEditorSupport.java:1432)
        at org.netbeans.modules.editor.hints.HintsControllerImpl.linePart(HintsControllerImpl.java:229)
        at org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription(ErrorDescriptionFactory.java:127)
        at org.netbeans.spi.editor.hints.ErrorDescriptionFactory.createErrorDescription(ErrorDescriptionFactory.java:120)
        at org.netbeans.modules.csl.hints.infrastructure.GsfHintsManager.createDescription(GsfHintsManager.java:513)
        at org.netbeans.modules.csl.hints.GsfHintsProvider$2.run(GsfHintsProvider.java:316)
        at org.netbeans.modules.csl.hints.GsfHintsProvider$2.run(GsfHintsProvider.java:338)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:129)
        at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:113)
Comment 20 Vitezslav Stejskal 2009-09-10 16:07:54 UTC
http://hg.netbeans.org/jet-main/rev/6b589056c5fc
Comment 21 Quality Engineering 2009-09-13 21:03:28 UTC
Integrated into 'main-golden', will be available in build *200909131354* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6b589056c5fc
User: Vita Stejskal <vstejskal@netbeans.org>
Log: #113933: better check for invalid hint ranges supplied by language hints providers
Comment 22 Michal Mocnak 2009-09-23 15:59:15 UTC
Build: NetBeans IDE Dev (Build 200909220201)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02-92, Java(TM) SE Runtime Environment, 1.6.0_15-b03-226
OS: Mac OS X, 10.5.8, x86_64

User Comments: 


Stacktrace: 
org.netbeans.modules.parsing.spi.ParseException
        at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:192)
        at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:99)
        at org.netbeans.modules.csl.hints.GsfHintsProvider.run(GsfHintsProvider.java:293)
        at org.netbeans.modules.csl.hints.GsfHintsProvider.run(GsfHintsProvider.java:98)
        at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:654)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
Comment 23 Michal Mocnak 2009-09-23 15:59:20 UTC
Created attachment 88204 [details]
stacktrace
Comment 24 Michel Graciano 2010-02-18 08:32:09 UTC
Created attachment 94292 [details]
stacktrace
Comment 25 Michel Graciano 2010-02-18 08:33:09 UTC
Created attachment 94293 [details]
stacktrace
Comment 26 Michel Graciano 2010-02-18 08:36:15 UTC
Created attachment 94295 [details]
Sample class file which trigger the exception
Comment 27 misterm 2010-03-10 12:38:56 UTC
Created attachment 95011 [details]
stacktrace
Comment 28 misterm 2010-03-10 12:39:56 UTC
Created attachment 95012 [details]
stacktrace
Comment 29 misterm 2010-03-10 12:40:58 UTC
Created attachment 95013 [details]
stacktrace
Comment 30 Jesse Glick 2010-04-20 15:13:59 UTC
Created attachment 97728 [details]
stacktrace
Comment 31 Jesse Glick 2010-04-20 15:16:59 UTC
Created attachment 97729 [details]
stacktrace
Comment 32 Petr Hejl 2011-10-07 19:37:32 UTC
Still present in 7.0.1.
Comment 33 Quality Engineering 2011-10-10 12:28:00 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/351260216703
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #113933: ErrorDescriptionFactory.createED(..., int start, int end) should check that start >= 0 and end >= start, so that the stack traces are as useful as possible.
Comment 34 David Strupl 2011-10-20 09:00:05 UTC
This looks like going through the hints - please have a look and potentially reassign if the problem should be fixed elsewhere. Thanks.
Comment 35 David Strupl 2011-10-20 09:01:26 UTC
Or maybe it is already fixed - I did not notice any new reports after 10.10.2011 - if it is the case please close. I am not sure why it was reopened.
Comment 36 Jan Lahoda 2011-10-20 13:04:40 UTC
Typically, this is a problem in the caller to ErrorDescriptionFactory.create, but as the part of the stacktrace inside EDF.create had too much elements, all were duplicated to this one. In 351260216703 I have put asserts much higher in the stacktrace, so if this happens, separate bugs should be created for separate callers.

I have also found a few exceptions coming from java.hints, corrected in:
http://hg.netbeans.org/jet-main/rev/61067eb21735
Comment 37 Quality Engineering 2011-10-24 14:12:44 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/61067eb21735
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #113933: making some more Java hints immune to -1 positions in the trees.