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

Bug 329161

Summary: [remoteservices] RemoteServiceRegistryImpl has possible NPE
Product: [RT] ECF Reporter: Scott Lewis <slewis>
Component: ecf.remoteservicesAssignee: Scott Lewis <slewis>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bugs.eclipse.org
Version: 3.4.0   
Target Milestone: 3.4.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Scott Lewis CLA 2010-10-31 11:43:10 EDT
In RemoteServiceRegistryImpl class, unpublish method is this code

final ArrayList services = (ArrayList) publishedServicesByClass.get(clazz);
services.remove(clazz)

If the clazz has previously been removed, then the services.remove(clazz) line will cause an NPE (as services will be null).

This should be changed to:

	final ArrayList services = (ArrayList) publishedServicesByClass.get(clazz);
	if (services != null) services.remove(serviceReg);

so that unpublish will be safely idempotent.
Comment 1 Scott Lewis CLA 2010-10-31 11:56:54 EDT
Fix pushed to master.
Comment 2 Markus Kuppe CLA 2010-11-01 03:49:42 EDT
If this is intended to appear in 3.4.1, I suggest fixing it in Release_3_4 first and then merge it to master. This is more easily done than picking individual commits from master.
Comment 3 Scott Lewis CLA 2010-11-01 10:36:08 EDT
(In reply to comment #2)
> If this is intended to appear in 3.4.1, I suggest fixing it in Release_3_4
> first and then merge it to master. This is more easily done than picking
> individual commits from master.

Yes, for future I will fix it in Release_3_4 first, but I still don't have command line client to do merge, and so please merge it into the Release_3_4 stream for this occasion.  I'll get fully instrumented as quickly as I can.
Comment 4 Markus Kuppe CLA 2010-11-01 10:56:48 EDT
(In reply to comment #3)
> please merge it into the Release_3_4
> stream for this occasion.

Done