Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315373 - [assist] completion proposes callout override with nothing to override
Summary: [assist] completion proposes callout override with nothing to override
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.7 M4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 06:21 EDT by Stephan Herrmann CLA
Modified: 2010-06-11 18:02 EDT (History)
0 users

See Also:


Attachments
test & fix (7.02 KB, patch)
2010-06-02 06:44 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-02 06:21:40 EDT
When creating a method binding using completion, sometimes a callout
override binding is proposed although no role method exists that would
be overridden by the callout.

The simplest example to reproduce this is

public class MyBase {
    void foo() {}
    public String toString() { return ""; }
}

public team class MyTeam {
    protected class R playedBy MyBase {
        // complete here and select binding to "foo"
    }
}

Moreover, the compiler doesn't actually complain about the bogus "=>"
binding token.
Comment 1 Stephan Herrmann CLA 2010-06-02 06:44:52 EDT
Created attachment 170775 [details]
test & fix

The new test testCompletionCalloutDeclaration1a witnesses why this happened:

The sorted array of base method contains "fubar" (the test object) and "toString".
When processing this array back to front inspecting "toString" causes kind
to be set to CALLOUT_OVERRIDE, which will then be applied to all subsequent
proposals, too.

Fixed by using a tmp local "curKind".
Comment 2 Stephan Herrmann CLA 2010-06-02 06:46:05 EDT
Patch has been released as r409.
Comment 3 Stephan Herrmann CLA 2010-06-11 17:57:05 EDT
Verified for M4 using build 201006111044
Comment 4 Stephan Herrmann CLA 2010-06-11 18:02:26 EDT
(In reply to comment #3)
> Verified for M4 using build 201006111044

OT build was actually 201006111053.