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 72611 - NPE when trying to add dependency which is not part of the universe
Summary: NPE when trying to add dependency which is not part of the universe
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-13 14:29 UTC by luciano_spj
Modified: 2006-02-16 12:51 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 luciano_spj 2006-02-13 14:29:09 UTC
This message throwed when I 'finish' button pressed to create a new Netbeans
module action:

A java.lang.reflect.InvocationTargetException exception has occurred.
Please report this at http://www.netbeans.org/community/issues.html,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your C:\Documents and
Settings\l107492\.netbeans\5.0\var\log folder.

Details follow bellow:

java.lang.reflect.UndeclaredThrowableException
	at $Proxy12.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	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.pumpEventsForHierarchy(EventDispatchThread.java:153)
	at java.awt.Dialog$1.run(Dialog.java:515)
	at java.awt.Dialog.show(Dialog.java:536)
	at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:810)
	at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:853)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:841)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1172)
	at org.openide.util.Mutex.readAccess(Mutex.java:209)
	at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:826)
	at java.awt.Component.show(Component.java:1300)
	at java.awt.Component.setVisible(Component.java:1253)
	at org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:461)
	at org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:334)
	at org.netbeans.modules.project.ui.actions.NewFile.doPerform(NewFile.java:117)
	at org.netbeans.modules.project.ui.actions.NewFile.actionPerformed(NewFile.java:94)
	at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:100)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	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)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:410)
	... 64 more
Caused by: java.lang.NullPointerException
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$AddModuleDependency.run(CreatedModifiedFilesFactory.java:391)
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFiles.run(CreatedModifiedFiles.java:154)
	at
org.netbeans.modules.apisupport.project.ui.wizard.action.NewActionIterator.instantiate(NewActionIterator.java:41)
	at
org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:949)
	at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:537)
	at
org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:376)
	at
org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:218)
	at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1197)
	at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:70)
	at org.openide.WizardDescriptor$9.run(WizardDescriptor.java:1676)
	at org.openide.WizardDescriptor$8.run(WizardDescriptor.java:1716)
	at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1161)
	at org.openide.WizardDescriptor.access$1100(WizardDescriptor.java:70)
	at
org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:1723)
	... 68 more
==>
java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:410)
	at $Proxy12.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	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.pumpEventsForHierarchy(EventDispatchThread.java:153)
	at java.awt.Dialog$1.run(Dialog.java:515)
	at java.awt.Dialog.show(Dialog.java:536)
	at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:810)
	at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:853)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:841)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1172)
	at org.openide.util.Mutex.readAccess(Mutex.java:209)
	at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:826)
	at java.awt.Component.show(Component.java:1300)
	at java.awt.Component.setVisible(Component.java:1253)
	at org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:461)
	at org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:334)
	at org.netbeans.modules.project.ui.actions.NewFile.doPerform(NewFile.java:117)
	at org.netbeans.modules.project.ui.actions.NewFile.actionPerformed(NewFile.java:94)
	at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:100)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	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)
Caused by: java.lang.NullPointerException
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$AddModuleDependency.run(CreatedModifiedFilesFactory.java:391)
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFiles.run(CreatedModifiedFiles.java:154)
	at
org.netbeans.modules.apisupport.project.ui.wizard.action.NewActionIterator.instantiate(NewActionIterator.java:41)
	at
org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:949)
	at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:537)
	at
org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:376)
	at
org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:218)
	at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1197)
	at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:70)
	at org.openide.WizardDescriptor$9.run(WizardDescriptor.java:1676)
	at org.openide.WizardDescriptor$8.run(WizardDescriptor.java:1716)
	at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1161)
	at org.openide.WizardDescriptor.access$1100(WizardDescriptor.java:70)
	at
org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:1723)
	... 68 more
==>
java.lang.NullPointerException
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFilesFactory$AddModuleDependency.run(CreatedModifiedFilesFactory.java:391)
	at
org.netbeans.modules.apisupport.project.CreatedModifiedFiles.run(CreatedModifiedFiles.java:154)
	at
org.netbeans.modules.apisupport.project.ui.wizard.action.NewActionIterator.instantiate(NewActionIterator.java:41)
	at
org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:949)
	at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:537)
	at
org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:376)
	at
org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:218)
	at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1197)
	at org.openide.WizardDescriptor.access$1600(WizardDescriptor.java:70)
	at org.openide.WizardDescriptor$9.run(WizardDescriptor.java:1676)
	at org.openide.WizardDescriptor$8.run(WizardDescriptor.java:1716)
	at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1161)
	at org.openide.WizardDescriptor.access$1100(WizardDescriptor.java:70)
	at
org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:1723)
	at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:410)
	at $Proxy12.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	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.pumpEventsForHierarchy(EventDispatchThread.java:153)
	at java.awt.Dialog$1.run(Dialog.java:515)
	at java.awt.Dialog.show(Dialog.java:536)
	at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:810)
	at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:853)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:841)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1172)
	at org.openide.util.Mutex.readAccess(Mutex.java:209)
	at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:826)
	at java.awt.Component.show(Component.java:1300)
	at java.awt.Component.setVisible(Component.java:1253)
	at org.openide.loaders.TemplateWizard.instantiateImpl(TemplateWizard.java:461)
	at org.openide.loaders.TemplateWizard.instantiate(TemplateWizard.java:334)
	at org.netbeans.modules.project.ui.actions.NewFile.doPerform(NewFile.java:117)
	at org.netbeans.modules.project.ui.actions.NewFile.actionPerformed(NewFile.java:94)
	at
org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(LookupSensitiveAction.java:100)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	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:234)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
	at java.awt.Component.processEvent(Component.java:5253)
	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.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	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)
Comment 1 Martin Krauskopf 2006-02-13 15:32:27 UTC
I'll take a look at it soon. Thanks for the report.
(better to attach long logs as an attachments - is more readable for us).
Comment 2 Martin Krauskopf 2006-02-13 16:14:25 UTC
> Please, note that I will create a new Cookie Action (Conditionally Enabled).

I found the culprit. It's definitelly bug. The problem is when one tries to add
dependency on a module which is not part of the target platform. So e.g. if you
are developing against NB 5.0 Platform (i.e. pure platform) and select "Project"
cookie which is from Project API (org.netbeans.modules.projectapi) which is not
part of the platform, exception is thrown (assertion when you run with -J-ea
switch) when you try to finish the wizard. Maybe there could be another similar
scenario.
Bad that we didn't catch it earlier - thanks for the catch. Could happen also
elsewhere.

As a workaround be sure that you select cookies only for which there is a module
in the target platform. For those five in combobox it is:

org.openide.loaders.DataObject   - org.openide.loaders
org.openide.cookies.EditCookie   - org.openide.nodes
org.openide.cookies.OpenCookie   - org.openide.nodes
org.netbeans.api.project.Project - org.netbeans.modules.projectapi
org.openide.cookies.EditorCookie - org.openide.text

Fix will be part of next apisupport update (5.0u1) which will be available
through the autoupdate center.
Comment 3 Martin Krauskopf 2006-02-14 08:22:29 UTC
Working on this. Fix is simple. I'll semi-silently ignore those cases in
Util.addDepenency() with informational message.
Comment 4 Martin Krauskopf 2006-02-14 08:44:13 UTC
Util.java; 1.33 -> 1.34;
test/unit/UtilTest.java; 1.15 -> 1.16;
Comment 5 Martin Krauskopf 2006-02-14 10:56:35 UTC
Util.java; 1.32.2.1 -> 1.32.2.2;
test/unit/UtilTest.java; 1.13.2.2 -> 1.13.2.3;
Comment 6 Jesse Glick 2006-02-14 17:05:48 UTC
Please clarify what you changed. There are two possible cases:

1. Your target platform is the NB Platform (separate download). You run a wizard
and ask to create some code which would require a dep on the Project API. The
wizard should display an error message and refuse to finish.

2. Your target platform is the IDE, but you have non-platform clusters disabled
in your suite. You run a wizard which would require a dep on the Project API.
Acceptable behaviors:

2a. As in #1, refuse to let the wizard finish.

2b. Allow the wizard to finish, but do not create a dep on the Project API in
the affected module. The code will not compile - will just say that the package
org.netbeans.api.projects.* could not be found, etc. The user has to add the dep
and include the module.

2c. Allow the wizard to finish and create a dep on the Project API in the
affected module. Trying to build the module will result in an error that the
module is excluded from the application. The user can fix this in the suite
customizer, along with any other dependencies.

2d. Like (2c) but also turn on the module in the suite's app config.

I would probably recommend (2c). (2d) is problematic and (2a) and (2b) both seem
impolite.

Please open fresh bugs for cases (1) and (2) as needed. I'm sure this patch was
at least an improvement (AssertionError is certainly no good) but we may need to
do more.
Comment 7 Martin Krauskopf 2006-02-15 07:53:51 UTC
The patch was very simple. It just fixes the NPE and thus always behaves as (2b). 

There is one more solution. Lets offer the user only classes ("Cookies") which
are parts of modules enables (installed) in the target platform. So simply when
the user starts the wizard and has disabled Project API the "Project" class will
just not be listed there in the Cookie combobox. Also if we enhance the list of
"default" cookies in the future the redundant one will not be offered and thus
will not bother the user with irrelevant cookies (e.g. JavaDataObject if he
disabled Java APIs modules, ...). Sounds this reasonably.
Comment 8 Jesse Glick 2006-02-15 22:35:32 UTC
What you suggest re. cookies to offer in the Action wizard sounds fine. Probably
a case #3. I was more talking about deps that are really mandated by the whole
wizard, not a particular user choice inside the wizard - e.g. Options Dialog SPI
for adding an option panel. If your platform does not currently include this
module, what should we do? That was what my #2 was about.
Comment 9 Martin Krauskopf 2006-02-16 12:51:59 UTC
Ok: 72720, 72722, 72723