Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328562 - WTPResourceFactoryRegistryKey used as a key in a HashMap but does not implement hashCode/equals
Summary: WTPResourceFactoryRegistryKey used as a key in a HashMap but does not impleme...
Status: NEW
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.common (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Chuck Bridgham CLA
QA Contact: Carl Anderson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-25 02:02 EDT by Carlin Rogers CLA
Modified: 2010-10-25 13:30 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 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.