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

Bug 345007

Summary: NPE browsing external plugin on search path
Product: [Eclipse Project] PDE Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ankur_sharma, curtis.windatt.public
Version: 3.7Flags: ankur_sharma: review+
Target Milestone: 3.7 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

Description John Arthorne CLA 2011-05-06 14:21:22 EDT
Build:

- Running the SDK, added all plug-ins to the search path
- Opened a class in an external plugin (Help from org.eclipse.help.base) in my case

-> Error occurred:

Caused by: java.lang.NullPointerException
	at org.eclipse.pde.internal.runtime.registry.model.ServiceRegistration.getUsingBundles(ServiceRegistration.java:76)
	at org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.getTopLevelElement(RegistryBrowserModelChangeListener.java:63)
	at org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.refreshTopLevelElements(RegistryBrowserModelChangeListener.java:99)
	at org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener.update(RegistryBrowserModelChangeListener.java:129)
	at org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener$1.run(RegistryBrowserModelChangeListener.java:26)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
Comment 1 John Arthorne CLA 2011-05-06 14:21:38 EDT
eclipse.buildId=I20110428-0200
java.version=1.6.0_22
Comment 2 John Arthorne CLA 2011-05-06 14:25:22 EDT
I kept getting this exception every couple of seconds until eventually I restarted to get rid of it.
Comment 3 Curtis Windatt CLA 2011-05-06 15:11:58 EDT
Created attachment 194975 [details]
Fix
Comment 4 Curtis Windatt CLA 2011-05-06 15:13:57 EDT
Anytime we access the registry model there is the possibility of it being null.  We check for null in most cases, but I found two cases where we do not (one of which is the one John is encountering).  I also commented the variable to remind future developers to check for it.

Ankur, please review for RC1.
Comment 5 Ankur Sharma CLA 2011-05-08 02:13:01 EDT
Applied to HEAD
Comment 6 Curtis Windatt CLA 2011-05-16 17:31:08 EDT
Verified the code change is in I20110514-0800