public class test {
public static void main(String[] args){
ClassPool pool = ClassPool.getDefault();
try {
CtClass cc=null;
cc = pool.get("com.test');
CtMethod m= cc.getDeclaredMethod("b") ;
m.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
try {
cc.writeFile();
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (CannotCompileException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} catch (NotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}