Examples of CtBehavior


Examples of javassist.CtBehavior

                return;
            }
            ctClass.instrument(new ExprEditor() {
                public void edit(MethodCall methodCall) throws CannotCompileException {
                    try {
                        CtBehavior where = null;
                        try {
                            where = methodCall.where();
                        } catch (RuntimeException e) {
                            // <clinit> access leads to a bug in Javassist
                            where = ctClass.getClassInitializer();
                        }

                        // filter caller methods
                        if (methodFilterCaller(where)) {
                            return;
                        }

                        // get the callee method name, signature and class name
                        CtMethod calleeMethod = methodCall.getMethod();
                        String calleeClassName = methodCall.getClassName();
                        if (!(calleeMethod.getName().equals("proceedWithCallJoinPoint") && calleeClassName
                                .equals("org.codehaus.aspectwerkz.joinpoint.management.JoinPointManager"))) {
                            return;
                        }
                        System.out.println("found smtg to REMOVE");
                        System.out.println("calleeMethod = " + calleeMethod.getName());
                        System.out.println("calleeClassName = " + calleeClassName);
                        System.out.println("methodCall = " + methodCall.indexOfBytecode());
                        methodCall.replace("{java.lang.System.out.println($args[0]); $_=null;}");
                        try {
                            CodeIterator it = where.getMethodInfo().getCodeAttribute().iterator();
                            it.move(methodCall.indexOfBytecode() - 5);
                            System.out.println("it.get() = " + it.get());
                            it.next();
                            System.out.println("it.get() = " + it.get());
                            it.next();
View Full Code Here

Examples of org.jboss.forge.furnace.proxy.javassist.CtBehavior

        ASTList mem = p.parseMember1(stable);
        try {
            if (mem instanceof FieldDecl)
                return compileField((FieldDecl)mem);
            else {
                CtBehavior cb = compileMethod(p, (MethodDecl)mem);
                CtClass decl = cb.getDeclaringClass();
                cb.getMethodInfo2()
                  .rebuildStackMapIf6(decl.getClassPool(),
                                      decl.getClassFile2());
                return cb;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.