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:
{code}
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);
m.setModifiers(mod);
Class newClass = cc.toClass(); // or cc.writeFile() if you wish to keep the changes
{/code}
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/783581#783581]
Start a new discussion in Javassist at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]