Friday 1 May 2020

Javassist: Pruning: Discard unnecessary information

When pruning is enabled, Javassist discard unnecessary attributes while pruning that object.

How to enable pruning?
ClassPool.doPruning = true;

How to disallow pruning for a particular CtClass?
Use stopPruning method of CtClass.
CtClass ctClass = pool.makeClass("com.sample.app.Arithmetic");
ctClass.stopPruning(true);
Previous                                                    Next                                                    Home

No comments:

Post a Comment