Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311927 - NPE from select required button on feature based launch config
Summary: NPE from select required button on feature based launch config
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 12:36 EDT by Curtis Windatt CLA
Modified: 2010-05-10 12:26 EDT (History)
1 user (show)

See Also:
curtis.windatt.public: review+


Attachments
Patch (1.57 KB, patch)
2010-05-07 12:46 EDT, Ankur Sharma CLA
curtis.windatt.public: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2010-05-06 12:36:47 EDT
1) Open a new Eclipse launch config
2) Open the plug-ins tab, set to "selected features below"
3) Hit add plug-in, add a random plug-in
4) Hit select required
Result:
NPE in the log because the method doesn't account for the new individual plug-in support.

eclipse.buildId=I20100429-1549
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_CA
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data /home/cwindatt/WS/Workspace Target -dev file:/home/cwindatt/WS/Workspace/.metadata/.plugins/org.eclipse.pde.core/Target/dev.properties -os linux -ws gtk -arch x86 -consoleLog -console


Error
Thu May 06 11:24:25 CDT 2010
Unhandled event loop exception

java.lang.ClassCastException: org.eclipse.pde.internal.ui.elements.NamedElement cannot be cast to org.eclipse.pde.internal.ui.launcher.FeatureBlock$FeatureLaunchModel
	at org.eclipse.pde.internal.ui.launcher.FeatureBlock$ButtonSelectionListener.handleAddRequired(FeatureBlock.java:308)
	at org.eclipse.pde.internal.ui.launcher.FeatureBlock$ButtonSelectionListener.widgetSelected(FeatureBlock.java:190)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1234)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.open(LaunchConfigurationsDialog.java:1125)
	at org.eclipse.debug.ui.DebugUITools$1.run(DebugUITools.java:398)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:406)
	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUITools.java:340)
	at org.eclipse.debug.ui.actions.LaunchAction.runWithEvent(LaunchAction.java:117)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1234)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3159)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2601)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2565)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2399)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:669)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:662)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Ankur Sharma CLA 2010-05-07 12:46:00 EDT
Created attachment 167507 [details]
Patch
Comment 2 Darin Wright CLA 2010-05-07 16:39:29 EDT
Looks like Ankur added the review flag (from bug mail), bug I don't see it here... so re-adding review flag for Curtis.
Comment 3 Ankur Sharma CLA 2010-05-08 02:44:18 EDT
(In reply to comment #2)
> Looks like Ankur added the review flag (from bug mail), bug I don't see it
> here... so re-adding review flag for Curtis.

I had marked the patch for review instead of the bug. Will I now need +1 on Bug from Curtis and on Patch from you(Darin)?
Comment 4 Darin Wright CLA 2010-05-08 11:18:23 EDT
Sorry, I didn't see the review flag on the patch (forgot to look there). You just need one +1/review.
Comment 5 Curtis Windatt CLA 2010-05-10 12:26:07 EDT
Fixed in HEAD.  The patch changed how the items were checked in the tree so I removed the two lines that were adding the checked items to a set that was never read.