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 96715 - IOOBE from LineRootElement.getElement
Summary: IOOBE from LineRootElement.getElement
Status: RESOLVED WORKSFORME
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: issues@editor
URL:
Keywords: RANDOM
: 112109 120031 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-27 19:02 UTC by Marian Petras
Modified: 2009-04-10 10:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
the exceptions (20.34 KB, text/plain)
2007-02-27 19:04 UTC, Marian Petras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2007-02-27 19:02:39 UTC
I am using automatic code-folding (auto-fold everything except nested classes).
I was manually refactoring a class by extracting some methods to separate
classes (subclasses). At one moment, I got an IndexOutOfBoundsException
("Invalid line index=1791 >= lineCount=1791") and since then, the editor became
unusable. I wanted to Cut (Ctrl-X) two methods from one source file and paste it
to the second file. But whenever I marked the block of two methods and pressed
Ctrl-X, I got the IOOBE. I found that I could Cut bodies of the methods (leaving
the method bodies empty) without getting the exception. But then, when I tried
to delete some of the method's curly braces (the goal was to replace
'methodSignature(){...}' with 'abstract methodSignature();'), I got other
exceptions of the same sort and the editor became visually totally broken - e.g.
it displayed several dozens duplicates of a single line across the whole screen.
I rather shut down the IDE and decided to finish the refactoring in ViM.

Here is the begginning of the first exception:
SEVERE [global]
java.lang.IndexOutOfBoundsException: Invalid line index=1791 >= lineCount=1791
        at o.netbeans.editor.LineRootElement.getElement(:92)
        at o.n.editor.DrawEngineDocView.createCustomView(:216)
        at o.n.lib.editor.view.GapBoxView.customReloadChildren(:1838)
        at o.n.editor.DrawEngineDocView.customReloadChildren(:197)
        at o.n.lib.editor.view.GapBoxView.reloadChildren(:1747)
        at o.n.lib.editor.view.GapBoxView.rebuild(:586)
        at o.n.lib.editor.view.GapBoxView.offsetRebuild(:609)
        at o.n.editor.DrawEngineDocView.foldHierarchyChanged(:294)
        ...

--
NetBeans IDE Dev (Build 070223)
1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
Linux version 2.6.14-1.1656_FC4 running on i386
en_US (nb); UTF-8
Comment 1 Marian Petras 2007-02-27 19:04:05 UTC
Created attachment 38955 [details]
the exceptions
Comment 2 Vitezslav Stejskal 2007-02-27 20:53:35 UTC
Thanks for the report. Was it just a random failure or can you reproduce it?
Comment 3 Marian Petras 2007-02-27 22:04:51 UTC
It was random but I was not brave enough to try to reproduce it.

Now I tried to reproduce it (with sources of other modules) but (un)fortunately
I was not able to break it.

When I encountered the exceptions, I was cutting methods from quite a long class
(about 2000 lines) and the CPU usage was high with every cut-and-paste
operation. I guess it is a threading issue.
Comment 4 Miloslav Metelka 2007-02-27 23:13:48 UTC
Generally this is an error of the views building mechanism but it may be hard to
find out what's exactly wrong.
I do not think that it's a threading problem - all seems to be done in the AWT.
Anyway for 6.0 I may at least try to make the code more robust so that it
notifies a problem but does not fail with an exception.
Comment 5 Vitezslav Stejskal 2007-10-19 10:47:49 UTC
*** Issue 112109 has been marked as a duplicate of this issue. ***
Comment 6 Vitezslav Stejskal 2007-10-26 12:22:17 UTC
*** Issue 120031 has been marked as a duplicate of this issue. ***
Comment 7 Jiri Prox 2008-04-11 00:41:39 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 8 Alexei Mokeev 2009-04-10 10:12:52 UTC
Played for a while with the scenario w/o any 'success' in reproducing it.
Also no duplicated reports in IZ since 6.0. Closing as WORKSFORME.