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

Bug 326843

Summary: [otmodel] need binding keys for phantom types
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Project Teams <objectteams.otdt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7.1   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Whiteboard:

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.