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.
Build 060103 - two forms open, switched from one form to another form and then clicked the tab area of a JTabbedPane occupying the full area of the other form. P2 since we want Matisse to look really good for 5.0. java.lang.NullPointerException at org.netbeans.modules.form.JavaCodeGenerator.generateComponentCreate (JavaCodeGenerator.java:1115) at org.netbeans.modules.form.JavaCodeGenerator.addCreateCode (JavaCodeGenerator.java:993) at org.netbeans.modules.form.JavaCodeGenerator.addCreateCode (JavaCodeGenerator.java:998) at org.netbeans.modules.form.JavaCodeGenerator.addCreateCode (JavaCodeGenerator.java:998) at org.netbeans.modules.form.JavaCodeGenerator.regenerateInitComponents (JavaCodeGenerator.java:815) at org.netbeans.modules.form.JavaCodeGenerator.regenerateCode (JavaCodeGenerator.java:2548) at org.netbeans.modules.form.JavaCodeGenerator$FormListener.formChanged (JavaCodeGenerator.java:2806) at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:979) at org.netbeans.modules.form.FormModel.sendEventImmediately (FormModel.java:1007) at org.netbeans.modules.form.FormModel.fireFormToBeSaved (FormModel.java:694) at org.netbeans.modules.form.FormEditor.saveFormData (FormEditor.java:273) at org.netbeans.modules.form.FormEditorSupport.saveDocument (FormEditorSupport.java:215) at org.netbeans.modules.java.JavaEditor$Save.save(JavaEditor.java:236) at org.openide.actions.SaveAction.performAction(SaveAction.java:51) at org.openide.util.actions.NodeAction$DelegateAction$1.run (NodeAction.java:531) at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction (ActionsBridge.java:47) at org.openide.util.actions.NodeAction$DelegateAction.actionPerformed (NodeAction.java:527) at org.openide.windows.TopComponent.processKeyBinding (TopComponent.java:854) at javax.swing.JComponent.processKeyBindings(JComponent.java:2912) at javax.swing.JComponent.processKeyEvent(JComponent.java:2829) at org.netbeans.modules.form.HandleLayer.processKeyEvent (HandleLayer.java:449) at java.awt.Component.processEvent(Component.java:5734) at java.awt.Container.processEvent(Container.java:1960) at java.awt.Component.dispatchEventImpl(Component.java:4365) at java.awt.Container.dispatchEventImpl(Container.java:2018) at java.awt.Component.dispatchEvent(Component.java:4195) at java.awt.KeyboardFocusManager.redispatchEvent (KeyboardFocusManager.java:1828) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent (DefaultKeyboardFocusManager.java:693) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent (DefaultKeyboardFocusManager.java:952) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions (DefaultKeyboardFocusManager.java:824) at java.awt.DefaultKeyboardFocusManager.dispatchEvent (DefaultKeyboardFocusManager.java:657) at java.awt.Component.dispatchEventImpl(Component.java:4237) at java.awt.Container.dispatchEventImpl(Container.java:2018) at java.awt.Window.dispatchEventImpl(Window.java:2300) at java.awt.Component.dispatchEvent(Component.java:4195) [catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Strike that, I think I clicked in the form designer, and immediately pressed Ctrl-S.
filed after the cut-off date for 5.0 Code Freeze, and it is definitelly not a P1 showstopper --> setting TM for future
Tim, are you able to reproduce this? I am not. Could you try to nail down the steps? There must be something special. The actual problem is that some component is not given variable name correctly - then the code generation fails (note the code is regenerated only on save or when you switch to source).
It's pretty random, but here's a guess: Some non-AWT thread is trying to run save code *while* the source is being regenerated, or something like that. I'd be willing to bet there's a race condition in there somewhere.
Looks it really is random. I think we had similar stack trace already reported (e.g. issue 70563, issue 69584, issue 69093) with no reproducibility. So far it always looked as consequence some previous failure (exception). The race condition is unlikely related to saving - e.g. your stack trace shows it is done in AWT as it should be. The cause of NPE is clearly in corrupted model of variables assigned to components (a component has no variable). The random failure is rather in adding a new component (is not assigned a variable sometimes), or in incorrect loading. If it happens again please try to check this.
*** Issue 71289 has been marked as a duplicate of this issue. ***
Closing as WORKSFORME. Feel free to reopen if you find steps to reproduce. The attached exception unfortunately is not sufficient to track the problem down.