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 145588 - [65cat] IndexOutOfBoundsException: Index: 4, Size: 0
Summary: [65cat] IndexOutOfBoundsException: Index: 4, Size: 0
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Miloslav Metelka
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2008-08-29 15:11 UTC by ulfzibis
Modified: 2008-10-03 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 89015


Attachments
Colouring broken (2.64 KB, image/jpeg)
2008-08-29 15:12 UTC, ulfzibis
Details
stacktrace (4.53 KB, text/plain)
2008-09-10 15:29 UTC, tboerkel
Details
stacktrace (4.05 KB, text/plain)
2008-09-12 02:56 UTC, baffyofdaffy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2008-08-29 15:11:27 UTC
After Ctrl-V in editor I did "Undo", "Redo"

... and then colouring was broken. (See attachment)

Build: NetBeans IDE Dev (Build 200808080201)
VM: Java HotSpot(TM) Client VM, 1.5.0_11-b03, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_11-b03
OS: Windows XP, 5.1, x86
User comments: 
STACKTRACE: (first 10 lines)
java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
        at org.netbeans.lib.editor.util.GapList.add(GapList.java:525)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove.addRegion(TrailingWhitespaceRemove.java:181)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.run(TrailingWhitespaceRemove.java:377)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.redo(TrailingWhitespaceRemove.java:397)
        at org.netbeans.editor.BaseDocumentEvent.redo(BaseDocumentEvent.java:363)
        at org.netbeans.editor.GuardedDocumentEvent.redo(GuardedDocumentEvent.java:78)
        at javax.swing.undo.CompoundEdit.redo(CompoundEdit.java:59)
        at org.netbeans.editor.BaseDocument$AtomicCompoundEdit.redo(BaseDocument.java:2162)
        at javax.swing.undo.UndoManager.redoTo(UndoManager.java:222)
        at javax.swing.undo.UndoManager.redo(UndoManager.java:311)
Comment 1 ulfzibis 2008-08-29 15:12:10 UTC
Created attachment 68635 [details]
Colouring broken
Comment 2 Vitezslav Stejskal 2008-09-01 12:18:34 UTC
I guess there are no reliable steps how to reproduce this?
Comment 3 ulfzibis 2008-09-01 12:39:16 UTC
Broken colouring I had more than once in last weeks, but I can't remember the different causes.
Comment 4 tboerkel 2008-09-10 15:29:02 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28
OS: Windows Server 2008, 6.0, x86

User Comments: 
Redo

Stacktrace: 
java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
        at org.netbeans.lib.editor.util.GapList.add(GapList.java:525)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove.addRegion(TrailingWhitespaceRemove.java:181)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.run(TrailingWhitespaceRemove.java:377)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.redo(TrailingWhitespaceRemove.java:397)
        at org.netbeans.editor.BaseDocumentEvent.redo(BaseDocumentEvent.java:363)
        at org.netbeans.editor.GuardedDocumentEvent.redo(GuardedDocumentEvent.java:78)
Comment 5 tboerkel 2008-09-10 15:29:16 UTC
Created attachment 69545 [details]
stacktrace
Comment 6 baffyofdaffy 2008-09-12 02:56:02 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) Client VM, 1.5.0_06-b05, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_06-b05
OS: SunOS, 5.10, x86

User Comments: 


Stacktrace: 
java.lang.IndexOutOfBoundsException: Index: 6, Size: 0
        at org.netbeans.lib.editor.util.GapList.add(GapList.java:525)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove.addRegion(TrailingWhitespaceRemove.java:181)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.run(TrailingWhitespaceRemove.java:377)
        at org.netbeans.modules.editor.lib.TrailingWhitespaceRemove$AddRegionEdit.redo(TrailingWhitespaceRemove.java:397)
        at org.netbeans.editor.BaseDocumentEvent.redo(BaseDocumentEvent.java:363)
        at org.netbeans.editor.GuardedDocumentEvent.redo(GuardedDocumentEvent.java:78)
Comment 7 baffyofdaffy 2008-09-12 02:56:05 UTC
Created attachment 69698 [details]
stacktrace
Comment 8 Miloslav Metelka 2008-09-12 11:21:56 UTC
This is the same cause like in issue 140446.

*** This issue has been marked as a duplicate of 140446 ***
Comment 9 Jiri Prox 2008-10-02 10:06:22 UTC
Seems that there is another problem - the issue #140446 is not happening any more (GapList.remove), but this
(GapList.add)   is still happening. See http://statistics.netbeans.org/analytics/detail.do?id=68340 - there are builds
at the end of list of duplicates which are newer than Jul 23 

more than 20 duplicates -> P2
Comment 10 Vitezslav Stejskal 2008-10-02 11:49:15 UTC
I'll leave that to Mila. Something is still not quite right when undoing changes in the editor after saving a file.
Jirko, do we know exact steps how to reproduce this? The steps would be very helpful. Thanks
Comment 11 Jiri Prox 2008-10-02 12:11:48 UTC
Sorry, I cannot find any steps to reproduce.
Comment 12 Miloslav Metelka 2008-10-02 23:33:34 UTC
Recomputation of index added for redo() so it should be fixed.
http://hg.netbeans.org/main/rev/6511c9df8196
Comment 13 Quality Engineering 2008-10-03 14:29:58 UTC
Integrated into 'main-golden', will be available in build *200810031107* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6511c9df8196
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #145588 - IndexOutOfBoundsException: Index: 4, Size: 0