This content has been marked as final.
Show 1 reply
-
1. Re: Can I delete the modifier of a method with Javassist?
doctorx Dec 15, 2012 10:42 AM (in response to scalable)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); m.setModifiers(mod); Class newClass = cc.toClass(); // or cc.writeFile() if you wish to keep the changes