Shouldn't that work? class Foo { | Object foo() { | return new Object(); | } | } | | public class Main { | public static void main(String[] args) throws NotFoundException, CannotCompileException { | ClassPool cp = ClassPool.getDefault(); | CtClass foocls = cp.get("jatest.Foo"); | CtMethod m = foocls.getMethod("foo", "()Ljava/lang/Object;"); | m.insertBefore("$r x = new Object();"); | } | }
I get: compile error: no such class: $r View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257305#4257305 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4257305 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user