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

Bug 328562

Summary: WTPResourceFactoryRegistryKey used as a key in a HashMap but does not implement hashCode/equals
Product: [WebTools] WTP Common Tools Reporter: Carlin Rogers <carlin.rogers>
Component: wst.commonAssignee: Chuck Bridgham <cbridgha>
Status: NEW --- QA Contact: Carl Anderson <ccc>
Severity: normal    
Priority: P3    
Version: 3.2.2   
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Carlin Rogers CLA 2010-10-25 02:02:39 EDT
Shouldn't the inner class WTPResourceFactoryRegistryKey of WTPResourceFactoryRegistry, implement hashCode() and equals() as it is used as the key in the HashMap of descriptors?
Comment 1 Carl Anderson CLA 2010-10-25 12:18:15 EDT
Chuck removed the hashCode and equals method implementations in version 1.7 of WTPResourceFactoryRegistryKey.  The comment for the change claims bug 175139, as does the commit on the next day.  However, the patch attached to the bug only handles the set of changes after this (from version 1.7 to 1.8, where these methods were already removed), and not the changes that removed these methods.

I am assigning this to Chuck for investigation, but targeting to future, since I am unsure of the need or impact of adding these methods back- it has been this way since WTP 2.0.0, and I do not know of any ill effects from the lack of these two methods.
Comment 2 Carlin Rogers CLA 2010-10-25 13:30:29 EDT
OK, thanks. I noticed this while investigating some memory leak issues with an adopter project. I see a default resource factory being registered multiple times (a different issue to resolve). Each instance is added to the HashMap though the keys are really the same, creating/leaving references from the map to each of the separate instances of the factory. Not a major issue, but am curious.