Bug 84064 - AST: Wrong source ranges for superconstructorinv with type args
Summary: AST: Wrong source ranges for superconstructorinv with type args
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-31 12:28 EST by Martin Aeschlimann CLA
Modified: 2005-02-16 12:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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