Bug 84064

Summary: AST: Wrong source ranges for superconstructorinv with type args
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2005-01-31 12:28:15 EST
20050131

In the following code, have a look at the source range of the
SuperConstructorInvocation node:
It does not include the expression ('x').

  public F() {
    x.<String>super();
  }

Same problem for the ConstructorInvocation
  public F() {
    x.<String>this();
  }
Comment 1 Olivier Thomann CLA 2005-01-31 12:33:53 EST
I will investigate.
Comment 2 Olivier Thomann CLA 2005-01-31 13:27:38 EST
In the second case,
x.<String>this();

note that there is no node corresponding to the 'x'. This is invalid. There is a
problem reported for it, but the node doesn't appear in the tree.

Now in the first case, x is part of the source range and it appears in the tree
as the expression of the SuperConstructorInvocation node.

Is this what you expect?
Comment 3 Olivier Thomann CLA 2005-01-31 13:40:24 EST
In second case, the constructor invocation is now tagged as MALFORMED.

Fixed and released in HEAD.
Regression tests added in ASTConverter15Test.test0128 and test0129.
Comment 4 Martin Aeschlimann CLA 2005-01-31 16:21:15 EST
You are right, the second example is bogos. Sorry for that!
Comment 5 Olivier Thomann CLA 2005-01-31 16:23:24 EST
No problem. As long as we produce a tree, I wanted to let you know what you
would get.
In the second case, the constructor invocation is tagged as MALFORMED since it
is not supposed to have a qualification. Hope this is good enough.
Comment 6 David Audel CLA 2005-02-16 12:47:30 EST
Verified in I20050215-2300