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

Bug 315310

Summary: [assist] creating before/after callin using completion should set return type to void
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 0.7   
Target Milestone: 0.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Implementation none

Description Stephan Herrmann CLA 2010-06-01 17:20:25 EDT
When a before or after callin is created using completion, the role side
will have the same return type as the base side. However, any role return
will simply be ignored.

Thus, it would be nicer to actually use "void" as the return type
so that users will not be tempted to return something meaningful
and later wonder, why that value is not used at runtime.

There is a technical challenge in this, because the callin modifier is 
selected after the role signature has already been generated.
Comment 1 Stephan Herrmann CLA 2010-09-10 19:37:50 EDT
Created attachment 178667 [details]
Implementation

This implementation 
 - adds a "void" option to the role method return type
   (for explicit selection, if the user wishes)
 - adds mechanism for changing the return type to "void" when
   a before or after binding operator has been selected

The technical issue is overcome by creating a custom Proposal,
where computeEdits() merges regular edits with the change to
the return type. Note, that the overall linked proposal holds
nested proposals for each option within a link group. That's the
trick for intercepting one of those options (modeled after how
TemplateProposals work with MultiVariables etc).

Interestingly this makes CreateMethodMappingCompletionProposal a class
with all these properties
 - role
 - role file
 - team (needed to host gateway role MyJavaLinkedCompletionProposal)
 - a team extending a non-team class
This is the stress test that triggered several recent bugs, but
by now it works OK.
Comment 2 Stephan Herrmann CLA 2010-09-10 19:39:59 EDT
Patch has been committed as r777.
Comment 3 Stephan Herrmann CLA 2010-09-23 17:24:28 EDT
Verified using I201009211735