Bug 22306

Summary: AST: Constructor contains syntetic SuperConstructorCall
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akiezun
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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).