Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 59984

Summary: NPE in Platform.getPlugin(String) when not running with compatibility
Product: [Eclipse Project] Equinox Reporter: Nick Edgar <n.a.edgar>
Component: IncubatorAssignee: User Unknown <unknown1>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Nick Edgar CLA 2004-04-26 13:42:09 EDT
build I20040420 + latest core from head

- run the RCP browser example, which does not require o.e.core.runtime.compatibility
- you get an NPE in Platfrom.getPlugin(String)

Thread [main] (Suspended (exception NullPointerException))
	Platform.getPlugin(String) line: 423
	DefaultPreferences.applyRuntimeDefaults() line: 164
	DefaultPreferences.loadDefaults() line: 276
	DefaultPreferences.load() line: 272
	DefaultPreferences(EclipsePreferences).create(IEclipsePreferences, String)
line: 247
	DefaultPreferences(EclipsePreferences).internalNode(IPath, boolean) line: 462
	DefaultPreferences(EclipsePreferences).node(String) line: 627
	PreferenceForwarder.getDefaultPreferences() line: 117
	PreferenceForwarder.<init>(String) line: 56
	WorkbenchPlugin(Plugin).getPluginPreferences() line: 317
	AbstractUIPlugin$CompatibilityPreferenceStore.initialize() line: 190
	WorkbenchPlugin(AbstractUIPlugin).getPreferenceStore() line: 604
	ActivityPersistanceHelper.loadEnabledStates() line: 75
	ActivityPersistanceHelper.<init>() line: 57
	ActivityPersistanceHelper.getInstance() line: 47
	Workbench.init(Display) line: 749
	Workbench.runUI() line: 1301
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 240
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 140
	BrowserApp.run(Object) line: 54
	PlatformActivator$1.run(Object) line: 283
	EclipseStarter.run(Object) line: 240
	EclipseStarter.run(String[], Runnable) line: 117
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available
[native method]
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
	Method.invoke(Object, Object[]) line: 324
	Main.basicRun(String[]) line: 267
	Main.run(String[]) line: 699
	Main.main(String[]) line: 683

This is hit in the changes for bug 58975, however the problem here is that
getPlugin causes an NPE rather than returning null as spec'ed.
Comment 1 DJ Houghton CLA 2004-04-26 14:06:30 EDT
Fixed and released to HEAD.