[jboss-user] [Javassist] - Re: Can I delete the modifier of a method with Javassist?

Nils Andreas Svee do-not-reply at jboss.com
Sat Dec 15 10:36:39 EST 2012

Nils Andreas Svee [https://community.jboss.org/people/doctorx] created the discussion

"Re: Can I delete the modifier of a method with Javassist?"

To view the discussion, visit: https://community.jboss.org/message/783581#783581

I would have done something like this:

ClassPool pool = ClassPool.getDefault();
CtClass cc = pool.get("ClsSync");

CtMethod m = cc.getDeclaredMethod("biat");
int oldMod = m.getModifiers();
int mod = Modifier.clear(oldMod, Modifier.SYNCHRONIZED);

Class newClass = cc.toClass(); // or cc.writeFile() if you wish to keep the changes

Reply to this message by going to Community

Start a new discussion in Javassist at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121215/c8742f99/attachment.html 

More information about the jboss-user mailing list