Community
Participate
Working Groups
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.