[Soot-list] Synthesizing a constructor

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Thu Jul 26 19:19:32 EDT 2012


Hello,

I am doing some transformation to initialize a field that would be 
initialized by dependency injection.

so I have something like @EJB private MyBean theBean;

And I want it to become:
private MyBean theBean = new MyBean();

First question:
Do I need to make this initialization inside a constructor? (I am 
guessing it is the case, and that the initialization part here is just 
syntactic sugar).

Second question:
If the constructor doesn't have a body yet, how do I create one? Which 
statements are required? (my guess: super() and then the initialization)

Third question:
Are there any utility methods in Soot to do this simply?

-- 
Marc-André Laverdière-Papineau
Étudiant au doctorat - PhD Student


More information about the Soot-list mailing list