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 47728 - Double click on a File Type in the New File wizard causes NPE
Summary: Double click on a File Type in the New File wizard causes NPE
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-08-23 18:05 UTC by jhoffman
Modified: 2004-09-07 16:46 UTC (History)
2 users (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 jhoffman 2004-08-23 18:05:41 UTC
Steps to reproduce:
1. Open IDE
2. Click the New File toolbar button (within a
project)
3. On the Choose File Type panel of the wizard,
choose Java GUI Forms
4. Double click on JApplet Form
5. NPE Occurs (see below).  Also note that a file
is created in the background, and the Finish
button has not been clicked yet.

java.lang.NullPointerException
	at
org.netbeans.modules.javacore.JMManager.getResource(JMManager.java:384)
	at
org.netbeans.modules.javacore.api.JavaModel.getResource(JavaModel.java:94)
	at
org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:258)
	at
org.netbeans.modules.form.FormEditorSupport$3.run(FormEditorSupport.java:543)
	at
org.netbeans.modules.form.FormLAF$1.run(FormLAF.java:58)
	at
org.openide.util.Mutex.doEventAccess(Mutex.java:923)
	at org.openide.util.Mutex.readAccess(Mutex.java:202)
	at
org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:43)
	at
org.netbeans.modules.form.FormEditorSupport.loadFormData(FormEditorSupport.java:541)
	at
org.netbeans.modules.form.FormEditorSupport.loadFormDesigner(FormEditorSupport.java:496)
	at
org.netbeans.modules.form.FormDesigner.componentShowing(FormDesigner.java:844)
	at
org.netbeans.core.multiview.MultiViewPeer.peerComponentShowing(MultiViewPeer.java:160)
	at
org.netbeans.core.multiview.MultiViewCloneableTopComponent.componentShowing(MultiViewCloneableTopComponent.java:107)
	at
org.openide.windows.WindowManager.componentShowing(WindowManager.java:281)
	at
org.netbeans.core.windows.WindowManagerImpl.componentShowing(WindowManagerImpl.java:905)
	at
org.netbeans.core.windows.view.DefaultView.changeGUI(DefaultView.java:160)
	at
org.netbeans.core.windows.ViewRequestor.dispatchRequest(ViewRequestor.java:229)
	at
org.netbeans.core.windows.ViewRequestor.processRequest(ViewRequestor.java:208)
	at
org.netbeans.core.windows.ViewRequestor.postRequest(ViewRequestor.java:148)
	at
org.netbeans.core.windows.ViewRequestor.scheduleRequest(ViewRequestor.java:89)
	at
org.netbeans.core.windows.Central.addModeOpenedTopComponent(Central.java:543)
	at
org.netbeans.core.windows.ModeImpl.addOpenedTopComponent(ModeImpl.java:249)
	at
org.netbeans.core.windows.WindowManagerImpl.topComponentOpen(WindowManagerImpl.java:953)
	at
org.openide.windows.TopComponent.open(TopComponent.java:276)
	at
org.openide.windows.TopComponent.open(TopComponent.java:268)
	at
org.openide.windows.CloneableOpenSupport.openCloneableTopComponent(CloneableOpenSupport.java:164)
	at
org.netbeans.modules.form.FormEditorSupport.openFormEditor(FormEditorSupport.java:128)
	at
org.netbeans.modules.form.FormDataObject$OpenEdit.open(FormDataObject.java:89)
	at
org.openide.actions.OpenAction.performAction(OpenAction.java:54)
	at
org.openide.util.actions.NodeAction$3.run(NodeAction.java:440)
	at
org.openide.util.actions.CallableSystemAction.doPerformAction(CallableSystemAction.java:116)
	at
org.openide.util.actions.NodeAction$DelegateAction.actionPerformed(NodeAction.java:438)
	at
org.openide.explorer.view.ListView.performObjectAt(ListView.java:488)
	at
org.openide.explorer.view.ListView$PopupSupport.mouseClicked(ListView.java:912)
	at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
	at
java.awt.Component.processMouseEvent(Component.java:5103)
	at
java.awt.Component.processEvent(Component.java:4897)
	at
java.awt.Container.processEvent(Container.java:1569)
	at
java.awt.Component.dispatchEventImpl(Component.java:3615)
	at
java.awt.Container.dispatchEventImpl(Container.java:1627)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3207)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at
java.awt.Container.dispatchEventImpl(Container.java:1613)
	at
java.awt.Window.dispatchEventImpl(Window.java:1606)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
[catch] at
java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:141)
	at java.awt.Dialog$1.run(Dialog.java:540)
	at java.awt.Dialog.show(Dialog.java:561)
	at
org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:727)
	at
org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:770)
	at
org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:758)
	at
org.openide.util.Mutex.doEventAccess(Mutex.java:923)
	at org.openide.util.Mutex.readAccess(Mutex.java:158)
	at
org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:743)
	at
org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:448)
	at
org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:351)
	at
org.netbeans.modules.project.ui.actions.NewFile.doPerform(NewFile.java:98)
	at
org.netbeans.modules.project.ui.actions.NewFile.actionPerformed(NewFile.java:75)
	at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:69)
	at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
	at
javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
	at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at
java.awt.Component.processMouseEvent(Component.java:5100)
	at
java.awt.Component.processEvent(Component.java:4897)
	at
java.awt.Container.processEvent(Container.java:1569)
	at
java.awt.Component.dispatchEventImpl(Component.java:3615)
	at
java.awt.Container.dispatchEventImpl(Container.java:1627)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
	at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
	at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
	at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
	at
java.awt.Container.dispatchEventImpl(Container.java:1613)
	at
java.awt.Window.dispatchEventImpl(Window.java:1606)
	at
java.awt.Component.dispatchEvent(Component.java:3477)
	at
java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
	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 Jan Becicka 2004-09-02 09:51:19 UTC
> 5. NPE Occurs (see below).  Also note that a file
> is created in the background, and the Finish
> button has not been clicked yet.

I fixed NPE. But the file should not be created on background if
Finish button has not been clicked. Reassigning to project for evaluation.

Checking in JMManager.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/JMManager.java,v
 <--  JMManager.java
new revision: 1.51; previous revision: 1.50
done
Comment 2 Jesse Glick 2004-09-06 22:20:50 UTC
Not sure what "file was created in the background" means in this
context. What file was created where? Had you filled in a name and
location yet?
Comment 3 jhoffman 2004-09-07 05:04:26 UTC
Let me clarify:
When the NPE occured, there was a new editor tab containing a file
called "JApplet" as I was not yet asked to supply the class name (this
is the next wizard step *after* the NPE occurs). The file was not
physically created, so after clearing the NPE you can cancel the
wizard and close the tab--no file will exist on the disk.  However,
given that you cancelled the wizard, it seems very odd that a tab for
the file would still exist (it should be closed automatically).
Comment 4 Petr Hrebejk 2004-09-07 10:30:52 UTC
It was calling the default action on the form templates. Disabled the
double-click in templates list.

Checking in
projects/projectui/src/org/netbeans/modules/project/ui/TemplatesPanelGUI.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/TemplatesPanelGUI.java,v
 <--  TemplatesPanelGUI.java
new revision: 1.29; previous revision: 1.28
done
Comment 5 Jesse Glick 2004-09-07 16:37:26 UTC
Shouldn't double-click just advance to the second wizard panel?
Comment 6 jrojcek 2004-09-07 16:43:44 UTC
I think I saw a user during a usability study who expected that. Seems reasonable to me as 
well.
Comment 7 Petr Hrebejk 2004-09-07 16:46:08 UTC
Sure. Wanted to do but gave up after very short consultation with
Jirka rechtacek and Tomas Zezua :-)