private static void modifyConstructor(EvaluationContext context,
final ArrayList<Statement> body) throws CompilerException {
boolean foundInit = firstIsSuperInit(body);
if (!foundInit) {
body.add(0,new ExprStatement(new CallExpr(new FieldVarExpr(new VarExpr("super",null),"<init>",null),new FIFO<Expr>(),null),null)) ;
}
StubResolver resolver = context.classDef ;
int pos = 1 ;
ClassStub stub = resolver.getStub() ;
for(FieldStub def: stub.fields.values()) {
if (!def.isStatic) {
if (def.initializer != null) {
SetValueExpr se = new SetValueExpr(new FieldVarExpr(new VarExpr("this",null),def.nm,null),def.initializer,null) ;
body.add(pos++,new ExprStatement(se,null)) ;
}
}
}
}