Community

Error adding new field like ArrayList

created by Toni Fernan in Javassist - View the full discussion

Hi everyone,

 

I am trying to add a complex field like ArrayList<String>, but for the moment I didn't have any luck.

 

 

String declaration = "private java.util.List<String> x = new java.util.ArrayList<java.lang.String>();";
 
CtField f = CtField.make(declaration, fieldClass);
 
fieldClass.addField(f);
 
fieldClass.writeFile();

 

Can someone tell me if this is possible? Thank you for any help

Reply to this message by going to Community

Start a new discussion in Javassist at Community