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 117403

Summary: ArrayIndexOutOfBoundsException in editor
Product: editor Reporter: steve_taylor <steve_taylor>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED FIXED    
Severity: blocker CC: dynamite, jglick, unr303
Priority: P2 Keywords: RANDOM
Version: 6.x   
Hardware: Other   
OS: Windows XP   
URL: http://statistics.netbeans.org/analytics/detail.do?id=4593
Issue Type: DEFECT Exception Reporter:
Attachments: Log
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
stacktrace
ide log
gestures
screenshot
ide log

Description steve_taylor 2007-10-02 08:01:40 UTC
Netbeans 6.0 beta 1.
Not sure about the subcomponent.
Was just typing as usual, and this exception started occurring repeatedly.
See attached log.
Comment 1 steve_taylor 2007-10-02 08:03:04 UTC
Created attachment 49958 [details]
Log
Comment 2 Vitezslav Stejskal 2007-10-04 10:14:33 UTC
I'm not sure what happened. The exception was thrown from OffsetsBag and indicates that it's intrenals got screwed up
for some reason. Are you able to reproduce it (at least approximately)? Thanks
Comment 3 Vitezslav Stejskal 2007-11-13 09:25:25 UTC
*** Issue 121761 has been marked as a duplicate of this issue. ***
Comment 4 Vitezslav Stejskal 2007-11-14 11:11:04 UTC
*** Issue 121384 has been marked as a duplicate of this issue. ***
Comment 5 tjansson 2007-12-11 09:57:44 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 6 tjansson 2007-12-11 09:57:47 UTC
Created attachment 54130 [details]
stacktrace
Comment 7 tjansson 2007-12-11 10:00:14 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b05
OS: Windows XP, 5.1, x86

User Comments: 
Tried to automatically format the code using key-combination [shift]+[alt]+[f].
Comment 8 tjansson 2007-12-11 10:00:17 UTC
Created attachment 54131 [details]
stacktrace
Comment 9 jojjeb 2007-12-11 15:04:19 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0-rc-b104
OS: Windows XP, 5.1, x86

User Comments: 
Adding java doc using the new auto javadoc action.
Comment 10 jojjeb 2007-12-11 15:04:25 UTC
Created attachment 54151 [details]
stacktrace
Comment 11 nighter 2007-12-15 19:55:17 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.6.0_03-b05
OS: Windows XP, 5.1, x86

User Comments: 
Comment 12 nighter 2007-12-15 19:55:21 UTC
Created attachment 54295 [details]
stacktrace
Comment 13 Exceptions Reporter 2007-12-19 13:26:32 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 14 Exceptions Reporter 2008-01-03 13:11:22 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 15 Exceptions Reporter 2008-01-11 23:40:40 UTC
THIS ISSUE HAS 5 MORE DUPLICATES
Comment 16 pzajac 2008-01-15 16:55:56 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.5.0_14-b03
OS: Linux, 2.6.20-16-generic, i386

User Comments: 
Comment 17 pzajac 2008-01-15 16:56:21 UTC
Created attachment 55087 [details]
stacktrace
Comment 18 pzajac 2008-01-31 09:51:21 UTC
Build: NetBeans IDE 6.0 (Build 200711261600)
VM: Java HotSpot(TM) Client VM, 1.5.0_14-b03
OS: Linux, 2.6.20-16-generic, i386

User Comments: 
Comment 19 pzajac 2008-01-31 09:51:25 UTC
Created attachment 55821 [details]
stacktrace
Comment 20 unr303 2008-02-01 12:01:55 UTC
Exception occured while i was editing code. I wasnt printing or painting. Code was
// Дата последней ревизии  $Date: 2008-01-18 12:36:05 +0300 (Пт, 18 янв 2008) $
// Дата последней проверки        YYYY-MM-DD
package foo;

/**
 * TODO: требуется документирование
 */
public class Foo<A extends List<Integer>,B,C,D extends Set<>> {

}
This exception also occurs every time i press CTRL+A or change selection.
Comment 21 unr303 2008-02-01 12:02:29 UTC
Created attachment 55904 [details]
ide log
Comment 22 unr303 2008-02-01 12:03:02 UTC
Created attachment 55905 [details]
gestures
Comment 23 unr303 2008-02-01 12:45:31 UTC
I was wrong. Exception occurs after press to any button! This blocks editing of file so P2.
Comment 24 unr303 2008-02-01 12:50:14 UTC
Created attachment 55909 [details]
screenshot
Comment 25 unr303 2008-02-01 12:50:52 UTC
There are also some problems with selection or something. See screenshot.
Comment 26 Jan Lahoda 2008-02-01 12:57:58 UTC
*** Issue 126487 has been marked as a duplicate of this issue. ***
Comment 27 Jan Becicka 2008-02-01 16:24:23 UTC
Please evaluate. Thanks
Comment 28 Vitezslav Stejskal 2008-02-05 16:05:11 UTC
It seems random or at least I can't reproduce it. Do you know any (even approximate) way how to reproduce it? Thanks
Comment 29 Jan Lahoda 2008-02-07 10:12:58 UTC
*** Issue 126264 has been marked as a duplicate of this issue. ***
Comment 30 Miloslav Metelka 2008-02-08 15:50:15 UTC
I've looked into OffsetsBag.removeHighlights() how could the problem happen and it seems that if the endOffset would be
above all the present marks' offsets and the clip==false which would btw correspond to
            bag.removeHighlights(rowStart, rowEnd, false);
in AnnotationHolder then
            int endIdx = indexBeforeOffset(endOffset, startIdx < 0 ? 0 : startIdx, marks.size() - 1);
would be marks.size()-1 and if
                if (endIdx != -1 && marks.get(endIdx).getAttributes() != null) {
                    endIdx++;
                }
then endIdx==marks.size() which would correspond to failing
                if (changeEnd == Integer.MIN_VALUE) {
                    changeEnd = marks.get(endIdx).getOffset();
                }
But I'm not familiar with the code much so I will study it more.
Comment 31 unr303 2008-02-11 09:51:16 UTC
Created attachment 56414 [details]
ide log
Comment 32 Exceptions Reporter 2008-02-16 11:53:16 UTC
THIS ISSUE HAS ALREADY 100 DUPLICATES
Comment 33 Miloslav Metelka 2008-02-22 17:19:54 UTC
I'm still unable to reproduce so I've decided to create a logging that would help us to investigate the problematic
case. Besides the logging the problematic index gets corrected to point to the last Mark of the OffsetsBag so the issue
should in fact be fixed.
I would like to ask unr303 and others who are able to reproduce the problem to use a dev build containing this fix and
attach messages.log to the issue for further analysis. Thanks.

Fixed in hg: a50612b2f287
Comment 34 Lukas Hasik 2008-03-04 12:58:38 UTC
Milo, the messages reported by users are automaticaly attached to the exceptionreport (see URL). So far no older message
than from 080211 build)
Comment 35 Vitezslav Stejskal 2008-03-05 10:31:19 UTC
*** Issue 129131 has been marked as a duplicate of this issue. ***
Comment 36 Vitezslav Stejskal 2008-03-25 14:01:47 UTC
*** Issue 128190 has been marked as a duplicate of this issue. ***