Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328642 - Registering FacesConfigResourceFactory multiple times
Summary: Registering FacesConfigResourceFactory multiple times
Status: NEW
Alias: None
Product: Java Server Faces
Classification: WebTools
Component: JSF Tools (show other bugs)
Version: 3.2.3   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: jsf inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 13:47 EDT by Carlin Rogers CLA
Modified: 2010-10-25 17:27 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlin Rogers CLA 2010-10-25 13:47:09 EDT
Noticed this while looking at memory leak issues. I think it is a minor issue but should probably get cleaned up some time.

I see our FacesConfigResourceFactory being registered multiple times - any time we create a new FacesConfigArtifactEdit instance and call getFacesConfig(). Seems like the "hack" that is in place (see comment in getFacesConfig()) to check if we've registered the factory is broken. I think we should try to fix this.

In addition, each instance is registered, adding to a HashMap in WTPResourceFactoryRegistry. Unfortunately, the key for the HashMap, WTPResourceFactoryRegistryKey, does not override hashCode/equals so though the keys are really the same, it creates references from the map to each of the separate instances of the factory.

A separate bug has been logged on about the HashMap key implementation.
See bug 328562.
Comment 1 Carlin Rogers CLA 2010-10-25 17:27:46 EDT
The FacesConfigPlugin inner plugin Implementation class' start() method is the first place to registers the FacesConfigResourceFactory.