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.
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.
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
We do not see how form can cause this behaviour. Reassigning to java.
Please provide detailed steps to reproduce. Thanks
Positions probably get corrupted. *** This issue has been marked as a duplicate of 69208 ***