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.
- create a new Blank Ant Project - go to Project Properties and open the customizer (...) - press Finish button You get the NPE : java.lang.NullPointerException at org.openide.filesystems.AbstractFolder.getFileObject (AbstractFolder.java:421) at org.apache.tools.ant.module.wizards.properties.PropertiesFil eProperty$PropertiesFileWizard.propertyChange (PropertiesFileProperty.java:187) at java.beans.PropertyChangeSupport.firePropertyChange (PropertyChangeSupport.java:252) at org.openide.NotifyDescriptor.firePropertyChange (NotifyDescriptor.java:535) at org.openide.NotifyDescriptor.setValue (NotifyDescriptor.java:428) at org.openide.WizardDescriptor.setValue (WizardDescriptor.java:673) at org.netbeans.core.NbPresenter$ButtonListener.actionPerformed (NbPresenter.java:933) at javax.swing.AbstractButton.fireActionPerformed (AbstractButton.java:1767) at javax.swing.AbstractButton$ForwardActionEvents.actionPerform ed(AbstractButton.java:1820) at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:419) at javax.swing.DefaultButtonModel.setPressed (DefaultButtonModel.java:257) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased (BasicButtonListener.java:258) at java.awt.Component.processMouseEvent (Component.java:5021) at java.awt.Component.processEvent (Component.java:4818) at java.awt.Container.processEvent (Container.java:1380) at java.awt.Component.dispatchEventImpl (Component.java:3526) at java.awt.Container.dispatchEventImpl (Container.java:1437) at java.awt.Component.dispatchEvent (Component.java:3367) at java.awt.LightweightDispatcher.retargetMouseEvent (Container.java:3214) at java.awt.LightweightDispatcher.processMouseEvent (Container.java:2929) at java.awt.LightweightDispatcher.dispatchEvent (Container.java:2859) at java.awt.Container.dispatchEventImpl (Container.java:1423) at java.awt.Window.dispatchEventImpl (Window.java:1566) at java.awt.Component.dispatchEvent (Component.java:3367) at java.awt.EventQueue.dispatchEvent (EventQueue.java:445) [catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:134) at java.awt.Dialog.show(Dialog.java:524) at org.netbeans.core.NbPresenter.superShow (NbPresenter.java:688) at org.netbeans.core.NbPresenter.run (NbPresenter.java:721) at org.openide.util.Mutex.doEventAccess (Mutex.java:917) at org.openide.util.Mutex.readAccess(Mutex.java:161) at org.netbeans.core.NbPresenter.show (NbPresenter.java:702) at org.openide.explorer.propertysheet.PropertyPanel$CustomizeLi stener.sheetButtonClicked(PropertyPanel.java:1840) at org.openide.explorer.propertysheet.SheetButton.notifySheetBu ttonListenersAboutClick(SheetButton.java:438) at org.openide.explorer.propertysheet.SheetButton$IL.mouseRelea sed(SheetButton.java:509) at java.awt.AWTEventMulticaster.mouseReleased (AWTEventMulticaster.java:227) at java.awt.Component.processMouseEvent (Component.java:5021) at java.awt.Component.processEvent (Component.java:4818) at java.awt.Container.processEvent (Container.java:1380) at java.awt.Component.dispatchEventImpl (Component.java:3526) at java.awt.Container.dispatchEventImpl (Container.java:1437) at java.awt.Component.dispatchEvent (Component.java:3367) at java.awt.LightweightDispatcher.retargetMouseEvent (Container.java:3214) at java.awt.LightweightDispatcher.processMouseEvent (Container.java:2929) at java.awt.LightweightDispatcher.dispatchEvent (Container.java:2859) at java.awt.Container.dispatchEventImpl (Container.java:1423) at java.awt.Window.dispatchEventImpl (Window.java:1566) at java.awt.Component.dispatchEvent (Component.java:3367) at java.awt.EventQueue.dispatchEvent (EventQueue.java:445) at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:144) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:138) at java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:130) at java.awt.EventDispatchThread.run (EventDispatchThread.java:98) WARNING - the WizardDescriptor.Panel implementation org.apache.tools.ant.module.wizards.properties.AddProperties Panel provides itself as the result of getComponent(). This can cause a clash when Component.isValid() is overridden. Please use a separate component class.
Jesse, my interpretation of this error is that PropertiesFileProperty.PropertiesFileWizard listens on WizardDescriptor and is notified about button press sooner that the WizardDescriptor.Panel.storeSettings is called. That means that PropertiesIterator.PROP_FILE_NAME is not set. It can be fixed by reading the values directly from the panels and not from the WizardDescriptor properties. Do you agree or is there some better solution. Strange is that this bug appeared so suddenly.
Surely storeSettings should be called before the Finish button press action is processed? Sounds like a regression in WizardDescriptor to me. If you can create a simple test case - and especially demonstrate that it worked as expected in 3.3 - please attach & reassign to openide/wizards.
Target milestone was changed from '3.4' to TBD.
Created attachment 6831 [details] WizardDescTest.java
Attached is the simple test case. Put it into root of your classpath, change compilation and execution to Internal and execute it. The wizard should appear. Press Finish button and check the output. In dev build (I expect that is not much different from release34 branch) Build 200207221004 the output is: readSettings of panel: first panel propertyChangeEvent=java.beans.PropertyChangeEvent[source=org.openide. WizardDescriptor@152e01] OK pressed - do something storeSettings of panel: first panel Important is that PropertyChange event OK_OPTION is received before the WizardDescriptor.Panel.storeSettings() was called. If I execute the same program in dev build 200206140100, the output is as I would expect - the OK_OPTION notification is fired after the storeSettings() was called: readSettings of panel: first panel propertyChangeEvent=java.beans.PropertyChangeEvent[source=org.openide. WizardDescriptor@258415] storeSettings of panel: first panel propertyChangeEvent=java.beans.PropertyChangeEvent[source=org.openide. WizardDescriptor@258415] OK pressed - do something Please evaluate and let me know what you think about it. It looks like regression.
Trung I think you also did some work on W.D. - maybe related? You seem to have made the only relevant changes in that class during the time period David mentions, in context of issue #12168 and issue #19213.
Need to investigate what change causes this bug.
Reason is that WizardDescriptor and NbPresenter listens to button: first listener calls resetWizard -> storeSettings second listener calls setValue -> propertyChange. Due to that (order in which events from button to its listeners CANNOT be specified) it is not possible to make sure that storeSettings is called BEFORE propertyChange. Fact that it worked before was just incidental. One solution could be to call WD.resetWizard from WD.setValue before super.setValue() -> propertyChange is called. I will test this possibility.
I attach diff for patch. It makes sure that storeSettings is called before propertyChange with OK_OPTION is called. (However I do not know if it does not break something else. Some tests for wizard would be very helpfull.
Created attachment 7018 [details] Diff of suggested fix
Passing to new owner
thanks marek, your patch is applied
verified in [nb_dev](20030115)