Bug 329988 - Quickfix method generation on missing replace callin method generates wrong method.
Summary: Quickfix method generation on missing replace callin method generates wrong m...
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7.1   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 0.8 M4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-11-11 07:21 EST by Jan Marc Hoffmann CLA
Modified: 2010-12-16 14:38 EST (History)
1 user (show)

See Also:


Attachments
tests & fix (29.42 KB, patch)
2010-11-13 17:37 EST, 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 Jan Marc Hoffmann CLA 2010-11-11 07:21:07 EST
Build Identifier: 

Hi again!

If you use the following code and try to use the quickfix offered wrong code gets generated.

Code:

public class Base {
    public int method(int i) {
        return 0;
    }
}

public team class QueryUtilityJava {
    protected class MyRole playedBy Base {
        myCallin <- replace method;
    }
}

If the quickfix on myCallin is used it generates the following:

callin void myCallin() {
}

Which should rather be:

callin int myCallin() {}

or even

callin int myCallin(int i) {}


The information for the generation should be available at this point.
This does only apply to the replace callins of course.

thanks and greetings 
Jan Marc


Reproducible: Always
Comment 1 Jan Marc Hoffmann CLA 2010-11-11 07:31:02 EST
(In reply to comment #0)
> Build Identifier: 
> 
> Hi again!
> 
> If you use the following code and try to use the quickfix offered wrong code
> gets generated.
> 
> Code:
> 
> public class Base {
>     public int method(int i) {
>         return 0;
>     }
> }
> 
> public team class QueryUtilityJava {
>     protected class MyRole playedBy Base {
>         myCallin <- replace method;
>     }
> }
> 
> If the quickfix on myCallin is used it generates the following:
> 
> callin void myCallin() {
> }
> 
> Which should rather be:
> 
> callin int myCallin() {}
> 
> or even
> 
> callin int myCallin(int i) {}
> 
> 
> The information for the generation should be available at this point.
> This does only apply to the replace callins of course.
> 
> thanks and greetings 
> Jan Marc
> 
> 
> Reproducible: Always

Which should rather be:
 
callin int myCallin() { return 0; }
 
or even
 
callin int myCallin(int i) { return 0; }
Comment 2 Stephan Herrmann CLA 2010-11-11 07:40:49 EST
Good point again. Scheduling for the M4 time frame.
Comment 3 Stephan Herrmann CLA 2010-11-13 17:37:48 EST
Created attachment 183082 [details]
tests & fix

This patch contains some tests and implementation which does the following:

- whenever an unresolved method spec without signature is quickfixed,
  infer the signature from the resolved method of the other side of the
  method binding (callin or callout)

- whenever a base method is being created but the role signature contains
  a role type, use the bound base type instead (lift/lower)

- whenever a role method is being created and the base signature contains
  a base type bound to a role of the current team, prefer the role type
  but also propose other types (more roles bound to the same base or the 
  base type itself) (again: lift/lower, if possible)

Also contained: a CCE fix in dom, required for one of the tests.
Comment 4 Stephan Herrmann CLA 2010-11-13 17:39:56 EST
Committed as r1026 ff.
Comment 5 Stephan Herrmann CLA 2010-12-16 14:38:39 EST
Verified for M4 using build 201012150343