Open abhinaswale opened 2 years ago
I'm unsure what transformation you try to accomplish. You want to convert CustomerHomeLocal customerHome = (CustomerHomeLocal)context.lookup(CustomerHomeLocal.JNDI_NAME);
to a field with an annotation
@Autowired
private CustomerHomeLocal customerHome;
? If this is your goal you want to create a new CtField(see https://spoon.gforge.inria.fr/mvnsites/spoon-core/apidocs/spoon/reflect/declaration/CtField.html) and add it to the CtClass with addField.
I want to remove some code from the class, identify the classname from it and create a variable for same class. I am able to do the first 2 parts but not able to add the code in CtClass as a variable. Please help.
Current code:
Expected Code
I have tried creating codeSnippet from
but not able to add it to