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 69107 - java.lang.NegativeArraySizeException at org.netbeans.editor.BaseDocument.getChars(BaseDocument.java:894)
Summary: java.lang.NegativeArraySizeException at org.netbeans.editor.BaseDocument.getC...
Status: RESOLVED DUPLICATE of bug 69208
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-22 14:50 UTC by nino80
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 nino80 2005-11-22 14:50:15 UTC
While adding an event handler to a gui component in Design view, something 
messed up and the editor merged the code from event handler with a part of my 
main class, keeping everything in blue-ish guarded code block, preventing me 
from doing any changes. Here's the trace:

java.lang.NegativeArraySizeException
	at org.netbeans.editor.BaseDocument.getChars(BaseDocument.java:894)
	at org.netbeans.editor.ext.ExtFormatter.reformat(ExtFormatter.java:257)
	at org.netbeans.editor.ext.ExtFormatter.reformat(ExtFormatter.java:274)
	at org.netbeans.editor.ActionFactory$FormatAction.
actionPerformed(ActionFactory.java:954)
	at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:194)
	at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1571)
	at javax.swing.JComponent.processKeyBinding(JComponent.java:2763)
	at javax.swing.JComponent.processKeyBindings(JComponent.java:2798)
	at javax.swing.JComponent.processKeyEvent(JComponent.java:2726)
	at java.awt.Component.processEvent(Component.java:5265)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.
java:1810)
	at java.awt.DefaultKeyboardFocusManager.
dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
	at java.awt.DefaultKeyboardFocusManager.
preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
	at java.awt.DefaultKeyboardFocusManager.
typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
	at java.awt.DefaultKeyboardFocusManager.
dispatchEvent(DefaultKeyboardFocusManager.java:636)
	at java.awt.Component.dispatchEventImpl(Component.java:3841)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at java.awt.EventDispatchThread.
pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.
pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

I'm using Netbeans 5.0 Beta 2.
Comment 1 Martin Roskanin 2005-11-22 16:02:38 UTC
Although I cannot reproduce the original problem, it seems it is somehow
connected with wrong doc positions. 
I reproduced the following: after adding a new event handler I removed the whole
line of the TODO comment and saved the file. After a parsing moment the code
folding side bar showed a wrong fold areas - document positions seem to be wrong.
I am not sure if this is a java problem or form. Reassigning to form for the
evaluation. 
Similar problem - issue #66744

Comment 2 Tomas Stupka 2005-11-23 09:36:37 UTC
We do not see how form can cause this behaviour. Reassigning to java. 
Comment 3 Jan Becicka 2005-11-24 09:01:20 UTC
Please provide detailed steps to reproduce. Thanks
Comment 4 Jan Becicka 2005-11-24 13:34:57 UTC
Positions probably get corrupted.

*** This issue has been marked as a duplicate of 69208 ***