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 48172 - AIOOBE from JSP editor during pasting
Summary: AIOOBE from JSP editor during pasting
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Miloslav Metelka
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2004-08-30 14:54 UTC by Marek Fukala
Modified: 2007-11-05 13:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The JSP file (3.26 KB, text/plain)
2004-08-30 14:56 UTC, Marek Fukala
Details
java.lang.ArrayIndexOutOfBoundsException (2.47 KB, text/plain)
2004-08-30 18:31 UTC, zikmund
Details
The minimalistic JSP file on which the AIOOBE can be reproduced (8 bytes, text/plain)
2004-08-31 11:59 UTC, Marek Fukala
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Fukala 2004-08-30 14:54:49 UTC
[20040829]
I have tried to paste a few lines of code into a
jsp file (included) and got this exception. Until
I closed the editor window the exception appeared
again and again.
Comment 1 Marek Fukala 2004-08-30 14:56:07 UTC
Created attachment 17226 [details]
The JSP file
Comment 2 zikmund 2004-08-30 18:31:04 UTC
I have same exception with this scenarion (100% reproducible)
1) In a JSP include empty line at position 2 (between 2 <@page ... lines)
2) Paste (Ctrl-V) a text which doesn't end with a new line (e.g. 1
character)
3) Undo (Ctrl-Z)
4) EXCEPTION -- see attachment
Comment 3 zikmund 2004-08-30 18:31:40 UTC
Created attachment 17231 [details]
java.lang.ArrayIndexOutOfBoundsException
Comment 4 Marek Fukala 2004-08-31 07:07:05 UTC
I forgot to attach my exception - anyway it was the some as Karel got.
Thank you Karle very much for the reproducible scenario. Great work!
Comment 5 Marek Fukala 2004-08-31 11:59:13 UTC
I likely found a minimal JSP file (attaching) on which the AIOOBE can
be reproduced. To reproduce place the cursor to the second line, press
a letter key - for example 'a' and then use editor Undo. The exception
is then thrown.
Comment 6 Marek Fukala 2004-08-31 11:59:50 UTC
Created attachment 17241 [details]
The minimalistic JSP file on which the AIOOBE can be reproduced
Comment 7 Marek Fukala 2004-08-31 15:10:37 UTC
It seems that the problem is in
org.netbeans.editor.FixLineSyntaxState.fixSyntaxStateInfos(undo) method.
 
When the undo operation is performed the method is called with
undo=true argument. Then maybeMatchLineIndex variable on line 328 is
wrongly set (the value is set to 1 (for the particualar case describe
above), what causes that the state infos are not updated). Then the
page parser fails with the AIIOBE due to wrong state infos.

Reassigning to editor module.
Comment 8 Miloslav Metelka 2004-08-31 17:26:14 UTC
I'll fix this.
Comment 9 Miloslav Metelka 2004-09-02 10:23:56 UTC
Fixed in trunk:
Checking in libsrc/org/netbeans/editor/FixLineSyntaxState.java;
/cvs/editor/libsrc/org/netbeans/editor/FixLineSyntaxState.java,v  <--
 FixLineSyntaxState.java
new revision: 1.3; previous revision: 1.2