Bug 118806 - ITypeBinding#getKey() is not stable for a local type after unrelated modifications
Summary: ITypeBinding#getKey() is not stable for a local type after unrelated modifica...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-01 08:44 EST by Markus Keller CLA
Modified: 2005-12-01 08:44 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2005-12-01 08:44:54 EST
I20051130-1215

ITypeBinding#getKey() is not stable for a local type after unrelated modifications. Currently, the key is based on a source code offset, which changes with the slightest code modification at a position before the type declaration. This is not in line with the spec of IBinding#getKey():
[..]
- local types - the name of the type, the index of the declaring block relative to its parent, the key of its method 
- anonymous types - the occurence count of the anonymous type relative to its declaring type, the key of its declaring type 
[..]

We first thought this would be a problem for us, but we found out that we can't use the key anyway for the concrete scenario we're working on. Nevertheless, it would be better to use the occurrence count and not the offet to identify a local type.