Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326843 - [otmodel] need binding keys for phantom types
Summary: [otmodel] need binding keys for phantom types
Status: NEW
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7.1   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Teams CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-02 14:11 EDT by Stephan Herrmann CLA
Modified: 2010-10-02 14:11 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2010-10-02 14:11:04 EDT
The test CodeCompletionTest.testNewExpression1() demonstrates that
information about a type being a phantom role cannot be transfered
using a binding key:

+ CompletionEngine.findAnonymousType() has a MemberTypeBinding with
  all necessary information, but has to encode this info into the
  InternalCompletionProposal using currentType.computeUniqueKey()

+ Later CompletionProposalCollector.createAnonymousTypeProposal()
  retrieves the type using fJavaProject.findElement(key, null),
  which creates a SourceType where actually a PhantomType is needed.

In this particular test isAnnotation() and isInterface() fail when
calling getElementInfo(), throwing JavaModelExceptions.

To avoid this, encoding (MemberTypeBinding.computeUniqueKey()) and
decoding (JavaProject.findElement(key..)) need to handle phantom roles.