Bug 83500 - Can't restore a secondary top level from key
Summary: Can't restore a secondary top level from key
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-23 08:40 EST by Dirk Baeumer CLA
Modified: 2019-11-18 06:02 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.