Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315310 - [assist] creating before/after callin using completion should set return type to void
Summary: [assist] creating before/after callin using completion should set return type...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.7.1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 17:20 EDT by Stephan Herrmann CLA
Modified: 2010-09-23 17:24 EDT (History)
0 users

See Also:


Attachments
Implementation (8.90 KB, patch)
2010-09-10 19:37 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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