Bug 81023 - [1.5] Wrong position for class instance creation with type parameters
Summary: [1.5] Wrong position for class instance creation with type parameters
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-14 18:01 EST by Olivier Thomann CLA
Modified: 2004-12-15 20:42 EST (History)
0 users

See Also:


Attachments
Apply on HEAD (2.82 KB, patch)
2004-12-14 22:02 EST, Olivier Thomann CLA
no flags Details | Diff
Apply on HEAD (2.38 KB, patch)
2004-12-14 22:25 EST, Olivier Thomann CLA
no flags Details | Diff
Apply on HEAD (2.21 KB, patch)
2004-12-14 22:29 EST, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2004-12-14 18:01:19 EST
Using latest, the position for the "new<String>...." doesn't include the new
keyword. This is wrong.

public class Test {
    public <U> Test(U u) {
    }

    void bar() {
        new <String> Test(null) {};
    }
}

The positions of the ClassInstanceCreation should include the new keyword.
For now, the corresponding source is "<String> Test(null) {}" instead of:
"new <String> Test(null) {}".
The corresponding method binding doesn't have a java element.
Comment 1 Olivier Thomann CLA 2004-12-14 18:06:23 EST
I will investigate.
Comment 2 Olivier Thomann CLA 2004-12-14 22:02:24 EST
Created attachment 16616 [details]
Apply on HEAD

Missing positions in the Parser has a side-effect on the AST converter.
Comment 3 Olivier Thomann CLA 2004-12-14 22:25:47 EST
Created attachment 16622 [details]
Apply on HEAD

Add regression tests
Comment 4 Olivier Thomann CLA 2004-12-14 22:29:50 EST
Created attachment 16623 [details]
Apply on HEAD
Comment 5 Olivier Thomann CLA 2004-12-15 10:56:29 EST
Fixed and released in HEAD.
Regression test added in ASTConverter15Test.
Comment 6 Olivier Thomann CLA 2004-12-15 20:42:30 EST
Verified in 200412160010