Bug 22306 - AST: Constructor contains syntetic SuperConstructorCall
Summary: AST: Constructor contains syntetic SuperConstructorCall
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-09 11:05 EDT by Martin Aeschlimann CLA
Modified: 2002-09-19 11:02 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2002-08-09 11:05:23 EDT
2.0 with update 2.0.1

Having the AST for class E
public class E {
  public E() {
    int i;
    int k;
  }
}

Look at statements of E: AST has 3 statements, including 
SuperConstructorInvocation with strange position.
Comment 1 Adam Kiezun CLA 2002-09-11 14:51:50 EDT
i think the ast should contain only nodes that exist in the code
or, there could be a flag indicating that it is not the case
Comment 2 Adam Kiezun CLA 2002-09-11 15:00:43 EDT
i think there's now no way to differentiate between:
class Inner{
	Inner(int t){
	}
}
and
class Inner{
        Inner(int t){
           super();
	}
}

except for the length of the super call, which is 12 (!) in the second case
Comment 3 Olivier Thomann CLA 2002-09-11 15:05:10 EDT
I think it makes sense to remove synthetic constructors from the AST. I will
investigate.
Comment 4 Olivier Thomann CLA 2002-09-11 15:41:27 EDT
Synthetic constructor calls are flagged as ImplicitSuper. So I am simply filter
them out when converting them.
So this method body reports 3 statements:
A() {
  super();
  int i;
  int j;
}

and this one reports only two statements:
A() {
  int i;
  int j;
}
Fixed and released in 2.1 stream.
Comment 5 David Audel CLA 2002-09-19 04:52:06 EDT
Verified.
Comment 6 Olivier Thomann CLA 2002-09-19 11:02:06 EDT
Regression tests added (test0399, test0400).