This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
modify existing class?
- From: "LuboÅ Svoboda" <svoboda dot lubos at gmail dot com>
- To: kawa at sourceware dot org
- Date: Tue, 14 Oct 2008 21:38:51 +0200
- Subject: modify existing class?
Hello,
is it posible to modify existing class using kawa? For example, I
would like to remove final modifier of the class and then save .class
to the filesystem.
I've tried following code but it doesn't work for my idea:
ClassType ct = ClassType.make("test.MyFinalClass");
ct.setModifiers(Access.PUBLIC);
int mod = ct.getModifiers();
System.out.println(mod);
byte[] classFile = ct.writeToArray();
System.out.println(classFile);
ClassTypeWriter.print(ct, System.out, 0);
There is always only empty class, my methods from test.MyFinalClass
are not there. Could someone help meM
Thanks!
Luba