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

Bug 324387

Summary: Illogical Code at PasswordProviderSelector.stop() method
Product: [Eclipse Project] Equinox Reporter: Heiko Techteam <techteam>
Component: SecurityAssignee: Security Inbox <equinox.security-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ob1.eclipse
Version: unspecified   
Target Milestone: 3.7 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Heiko Techteam CLA 2010-09-03 05:49:38 EDT
Build Identifier: I20100608-0911

Inside the PasswordProviderSelector at instance creation, you do add himself as IRegistryEventListener.

Inside the stop() method you did it again:

public void stop() {
   if (instance != null) {
	IExtensionRegistry registry = RegistryFactory.getRegistry();
	registry.addListener(instance, EXTENSION_POINT);
	instance = null;
}
	}


At this point, should not do unregister this listener? with:

public void stop() {
   if (instance != null) {
	IExtensionRegistry registry = RegistryFactory.getRegistry();
	registry.removeListener(instance);
	instance = null;
}

Reproducible: Always
Comment 1 Oleg Besedin CLA 2010-09-27 15:09:37 EDT
You are quite correct, that was probably a copy/paste artifact. Fixed in CVS Head. Thank you for taking time to figure this out!