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

Bug 326839

Summary: [otmodel][assist] completion proposals for implicitly inherited elements have no additional info
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.7.1   
Target Milestone: 0.8 M3   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
tests & fix
none
additional fix none

Description Stephan Herrmann CLA 2010-10-02 08:31:38 EDT
When completing a method call via a phantom role no additional info
(i.e., java doc) is displayed, because the type cannot be resolved
in the model.

It seems that JavaProject must be able to create PhantonType instances
accordingly, which may have impact also for other functions.
Comment 1 Stephan Herrmann CLA 2010-10-02 13:37:11 EDT
Created attachment 180110 [details]
tests & fix

The immediate issue is fixed by making JavaProject.findType smarter:
If member type is not found locally, also climb up the team-super-chain
to find an inherited role, collecting all candidates for creation of
a PhantomType.

PhantomType had to be extended to handle multiple tsuper roles.
This is necessary so that method lookup will be able to find methods
from all tsupers.

Note, that testNewExpression1() throws some JavaModelExceptions(not present)
because getElementInfo() is attempted on a SourceType representing a 
phantom role. This issue should be tracked separately.
Comment 2 Stephan Herrmann CLA 2010-10-02 13:56:53 EDT
Patch has been committed as r925 - r927
Comment 3 Stephan Herrmann CLA 2010-10-03 11:32:14 EDT
Field tests show that the following case is still not handled:
- role is real (=not phantom)
- method is inherited from tsuper

It shows that the copied method is used for the proposal,
from which no javadoc can be found.

Reopening.
Comment 4 Stephan Herrmann CLA 2010-10-04 18:45:01 EDT
Created attachment 180219 [details]
additional fix

This patch fixes the latest issue by using the copyInheritanceSrc 
during completion.

Test included.
Comment 5 Stephan Herrmann CLA 2010-10-04 18:52:48 EDT
additional fix has been committed as r935, r936

Note that the fix bug 326969 is required for some tests to pass.
Comment 6 Stephan Herrmann CLA 2010-11-10 19:17:41 EST
Verified for 0.8 M3 using build 201011100445