Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329161 - [remoteservices] RemoteServiceRegistryImpl has possible NPE
Summary: [remoteservices] RemoteServiceRegistryImpl has possible NPE
Status: RESOLVED FIXED
Alias: None
Product: ECF
Classification: RT
Component: ecf.remoteservices (show other bugs)
Version: 3.4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Scott Lewis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-31 11:43 EDT by Scott Lewis CLA
Modified: 2010-11-01 10:56 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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