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

Bug 332460

Summary: InferredType#addAttribute adding attribute to hash map with wrong key
Product: [WebTools] JSDT Reporter: Ian Tewksbury <itewksbu>
Component: GeneralAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: cmjaun
Version: 3.2.3Flags: cmjaun: review+
thatnitind: review+
Target Milestone: 3.2.3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix Patch none

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.