Community
Participate
Working Groups
If you follow the instructions for setting up the sun animator demo, then add a run/debug configuration for it and finally close the project. Try to edit configurations and you'll get the exception a seen below... java.lang.NullPointerException at org.eclipse.jdt.internal.appletlauncher.ui.AppletMainTab.getProjectOutputDirectory(AppletMainTab.java:458) at org.eclipse.jdt.internal.appletlauncher.ui.AppletMainTab.performApply(AppletMainTab.java:186) at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.performApply(AbstractLaunchConfigurationTabGroup.java:90) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.updateWorkingCopyFromPages(LaunchConfigurationDialog.java:1848) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.isWorkingCopyDirty(LaunchConfigurationDialog.java:1338) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.updateButtons(LaunchConfigurationDialog.java:2288) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.refreshStatus(LaunchConfigurationDialog.java:651) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.setLaunchConfiguration(LaunchConfigurationDialog.java:1236) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.selectionChanged(LaunchConfigurationDialog.java:1121) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1064) at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:813) at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:342) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.displayFirstConfig(LaunchConfigurationDialog.java:408) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.createContents(LaunchConfigurationDialog.java:386) at org.eclipse.jface.window.Window.create(Window.java:263) at org.eclipse.jface.window.Window.open(Window.java:512) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.doLastLaunchedConfig(LaunchConfigurationDialog.java:463) at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationDialog.open(LaunchConfigurationDialog.java:436) at org.eclipse.debug.internal.ui.actions.OpenLaunchConfigurationsAction.run(OpenLaunchConfigurationsAction.java:133) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:75) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1412) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1208) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:883) at org.eclipse.ui.internal.Workbench.run(Workbench.java:866) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:733) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:162) at org.eclipse.core.launcher.Main.run(Main.java:588) at org.eclipse.core.launcher.Main.main(Main.java:437)
Using the latest version, I cannot reproduce the NPE. I simply get an error after the launch saying the Main type doesn't exist. I cannot get rid of this error. One of the reasons is that I am checking before invoking the appletlauncher that the "main type" is a subclass of java.applet.Applet. In order to do this, I use the Java model underneath (org.eclipse.jdt.core plugin). But the model cannot retrieve types in a closed project. So I am afraid I cannot improve this behavior. Which build did you use to get a NPE?
I added a protection against the NPE, but you cannot expect to be able to run code, which belongs to a close project. The underneath Java model doesn't contain any information about types, methods, etc. contained in such a project. The code will be released after the next integration build (Tuesday's next week).