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 51633 - DocumentContent.copySpanChars() throwing ArrayOutOfBoundsException
Summary: DocumentContent.copySpanChars() throwing ArrayOutOfBoundsException
Status: RESOLVED WORKSFORME
Alias: None
Product: javame
Classification: Unclassified
Component: Fragmentation (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P4 blocker (vote)
Assignee: Adam Sotona
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-18 11:17 UTC by gc
Modified: 2007-05-21 16:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gc 2004-11-18 11:17:06 UTC
Very rarely, following exception is being thrown
when used with J2ME modules.  The J2ME code that
instigates the problem is: 

String
docText=document.getText(0,document.getLength()); 

which i don't think should be a problem.  

java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at
org.netbeans.editor.DocumentContent.copySpanChars(DocumentContent.java:227)
	at
org.netbeans.editor.DocumentContent.getText(DocumentContent.java:149)
	at
org.netbeans.editor.DocumentContent.getString(DocumentContent.java:133)
	at
javax.swing.text.AbstractDocument.getText(AbstractDocument.java:772)
	at
org.netbeans.modules.kjava.j2meproject.preprocessor.PPDocumentSource.<init>(PPDocumentSource.java:33)
	at
org.netbeans.modules.kjava.editor.ConfigMarkBlockChain.updateBlocks(ConfigMarkBlockChain.java:59)
	at
org.netbeans.modules.kjava.editor.J2MEEditorDocument.updateBlockChain(J2MEEditorDocument.java:170)
	at
org.netbeans.modules.kjava.editor.J2MEEditorDocument$1.actionPerformed(J2MEEditorDocument.java:133)
	at
javax.swing.Timer.fireActionPerformed(Timer.java:271)
[catch] at
javax.swing.Timer$DoPostEvent.run(Timer.java:201)
	at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
	at
java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
	at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
	at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Comment 1 Miloslav Metelka 2007-03-27 12:24:25 UTC
This is caused by a missing document read-lock from j2me code before calling
doc.getText(). Reassigning to mobility.
Comment 2 Adam Sotona 2007-05-21 16:08:56 UTC
The implementation of editor support in Mobility has changed significantly.
I havent seen the exception in 6.0. 
Closing as WORKSFORME, please reopen if occures again.