Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332460 - InferredType#addAttribute adding attribute to hash map with wrong key
Summary: InferredType#addAttribute adding attribute to hash map with wrong key
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-13 13:26 EST by Ian Tewksbury CLA
Modified: 2010-12-15 10:44 EST (History)
1 user (show)

See Also:
cmjaun: review+
thatnitind: review+


Attachments
Fix Patch (1.31 KB, patch)
2010-12-13 13:52 EST, Ian Tewksbury CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-12-13 13:26:56 EST
In InferredType a hash map is used to keep track of all of the attributes. in #addAttribute is where new attributes are added to this map.  Currently all attributes are being added with a key of "name" which is the name of the InferredType the attribute is being added to.  In reality the key should be "newAttribute.name".

Because of this mistake when using #findAttribute it never finds an attribute you are looking for because the only key in the HashMap is the type name instead of all of the attribute names.
Comment 1 Ian Tewksbury CLA 2010-12-13 13:52:59 EST
Created attachment 185086 [details]
Fix Patch

Fixes the key used to add attributes tot he attributes hash table.
All existing JUnits pass.
Comment 2 Chris Jaun CLA 2010-12-15 10:44:51 EST
Checked into 3.2.3 and HEAD.