Bug 27394 - code assist and anonymous implemenentations
Summary: code assist and anonymous implemenentations
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 3.3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-29 10:26 EST by Gunnar Wagenknecht CLA
Modified: 2007-06-29 04:48 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2002-11-29 10:26:42 EST
I20021119

new project test

---
simple interface:
---
package test;
public interface Test 
{
    void doStuff();
}

---
simple class:
---
package test;
public class TestClass
{
    public TestClass()
    {
        super();
    }
}

---
now the following situation:
---
    public TestClass()
    {
        super();
        Test test = new Test(<cursor>) // important: closing ")" inserted
                                       // automatically by typing "("
    }

code assist creats anonymous implementation if invoked on cursor postion, but 
the result will be:

    public TestClass()
    {
        Test test = new Test()
        {
            /* (non-Javadoc)
             * @see test.Test#doStuff()
             */
            public void doStuff()
            {}
         }<cursor>)
    }


You see the additional ")" after the cursor? Its wrong! IMHO the code assist 
doesn't recognize that there was already a closing ")" and so an additional was 
inserted.
Comment 1 David Audel CLA 2002-12-05 11:34:54 EST
Code assist engine doesn't look at right of the cursor because it doesn't know 
if tokens at right are related to the completion.

foo(new X(<cursor>)

In the previous example there is no way to know if the right parenthesis is 
related to 'foo' or 'new X('.
Comment 2 David Audel CLA 2002-12-12 06:38:27 EST
Currently code assist engine doesn't look at right.

Defering.
Comment 3 David Audel CLA 2007-06-29 04:48:06 EDT
Reopen
Comment 4 David Audel CLA 2007-06-29 04:48:24 EDT
Cannot be reproduced with 3.3. Fixed in a previous build.