Bug 83500

Summary: Can't restore a secondary top level from key
Product: [Eclipse Project] JDT Reporter: Dirk Baeumer <dirk_baeumer>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hanze.wang, markus.kell.r
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dirk Baeumer CLA 2005-01-23 08:40:26 EST
Example:

package p;

public class TwoTypes {
}

class SecondType {
}

- create key for SecondType.
- try to restore it using ASTParser.createASTs.
- null is returned

This is type can be used outside of CU TwoTypes.java it should be possible to
restore that key.

Problem seems to be in NameLookup#seekTypesInSourcePackage

Jerome, this PR is important for use for the new canAssign implementation we did
to overcome the contest limitations of ITypeBinding#isAssignmentCompatible
Comment 1 Dirk Baeumer CLA 2005-01-23 09:20:43 EST
Markus I have to diable test testCuSuperAndSub() due to this.
Comment 2 Jerome Lanneluc CLA 2005-02-07 04:37:58 EST
Added support for secondary type in SourceTypeBinding#computeBindingKey(),
NamedMember#getKey(IType), BindingKeyParser#consumeSecondaryType(char[]).

Added regression tests: BatchASTCreationTests#test052 and test053,
BindingKeyTests#test012 and test013
Comment 3 David Audel CLA 2005-02-15 11:53:51 EST
Verified in I20050214-0927
Comment 4 Markus Keller CLA 2005-03-02 07:49:00 EST
This still doesn't work if the CU does not contain a type with the same name as
the CU. E.g. in p/A.java:

package p;
class One { }
class Two { }

... the keys for One and Two cannot be restored.
Comment 5 Jerome Lanneluc CLA 2005-03-02 09:08:34 EST
Can you please enter a separate bug report ? This bug itself (as reported in
comment #0) is fixed.
Comment 6 Jerome Lanneluc CLA 2005-03-02 09:09:16 EST
Was verified by David
Comment 7 Markus Keller CLA 2005-03-02 09:23:52 EST
Sorry. Comment 4 filed as new bug 86990.