Refine search
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Helper method to add the code necessary to throw the given * exception type, sans message. */ private Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Throw an exception of the given type. */ protected Instruction throwException(Code code, Class type) { Instruction ins = code.anew().setType(type); code.dup(); code.invokespecial().setMethod(type, "<init>", void.class, null); code.athrow(); return ins; }
/** * Proxy the given setter method to dirty the proxy owner. */ private void proxySetter(BCClass bc, Class type, Method meth) { Class[] params = meth.getParameterTypes(); Class ret = meth.getReturnType(); BCMethod m = bc.declareMethod(meth.getName(), ret, params); m.makePublic(); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(true); code.invokestatic().setMethod(Proxies.class, "dirty", void.class, new Class[] { Proxy.class, boolean.class }); code.aload().setThis(); for (int i = 0; i < params.length; i++) code.xload().setParam(i).setType(params[i]); code.invokespecial().setMethod(type, meth.getName(), ret, params); code.xreturn().setType(ret); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Proxy the given setter method to dirty the proxy owner. */ private void proxySetter(BCClass bc, Class type, Method meth) { Class[] params = meth.getParameterTypes(); Class ret = meth.getReturnType(); BCMethod m = bc.declareMethod(meth.getName(), ret, params); m.makePublic(); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(true); code.invokestatic().setMethod(Proxies.class, "dirty", void.class, new Class[] { Proxy.class, boolean.class }); code.aload().setThis(); for (int i = 0; i < params.length; i++) code.xload().setParam(i).setType(params[i]); code.invokespecial().setMethod(type, meth.getName(), ret, params); code.xreturn().setType(ret); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Create pass-through constructors to base type. */ private void delegateConstructors(BCClass bc, Class type) { Constructor[] cons = type.getConstructors(); Class[] params; BCMethod m; Code code; for (int i = 0; i < cons.length; i++) { params = cons[i].getParameterTypes(); m = bc.declareMethod("<init>", void.class, params); m.makePublic(); code = m.getCode(true); code.aload().setThis(); for (int j = 0; j < params.length; j++) code.xload().setParam(j).setType(params[j]); code.invokespecial().setMethod(cons[i]); code.vreturn(); code.calculateMaxStack(); code.calculateMaxLocals(); } }
/** * Create pass-through constructors to base type. */ private void delegateConstructors(BCClass bc, Class type) { Constructor[] cons = type.getConstructors(); Class[] params; BCMethod m; Code code; for (int i = 0; i < cons.length; i++) { params = cons[i].getParameterTypes(); m = bc.declareMethod("<init>", void.class, params); m.makePublic(); code = m.getCode(true); code.aload().setThis(); for (int j = 0; j < params.length; j++) code.xload().setParam(j).setType(params[j]); code.invokespecial().setMethod(cons[i]); code.vreturn(); code.calculateMaxStack(); code.calculateMaxLocals(); } }
/** * Create pass-through constructors to base type. */ private void delegateConstructors(BCClass bc, Class type) { Constructor[] cons = type.getConstructors(); Class[] params; BCMethod m; Code code; for (int i = 0; i < cons.length; i++) { params = cons[i].getParameterTypes(); m = bc.declareMethod("<init>", void.class, params); m.makePublic(); code = m.getCode(true); code.aload().setThis(); for (int j = 0; j < params.length; j++) code.xload().setParam(j).setType(params[j]); code.invokespecial().setMethod(cons[i]); code.vreturn(); code.calculateMaxStack(); code.calculateMaxLocals(); } }
/** * Proxy the given setter method to dirty the proxy owner. */ private void proxySetter(BCClass bc, Class type, Method meth) { Class[] params = meth.getParameterTypes(); Class ret = meth.getReturnType(); BCMethod m = bc.declareMethod(meth.getName(), ret, params); m.makePublic(); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(true); code.invokestatic().setMethod(Proxies.class, "dirty", void.class, new Class[] { Proxy.class, boolean.class }); code.aload().setThis(); for (int i = 0; i < params.length; i++) code.xload().setParam(i).setType(params[i]); code.invokespecial().setMethod(type, meth.getName(), ret, params); code.xreturn().setType(ret); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }
/** * Proxy the given setter method to dirty the proxy owner. */ private void proxySetter(BCClass bc, Class type, Method meth) { Class[] params = meth.getParameterTypes(); Class ret = meth.getReturnType(); BCMethod m = bc.declareMethod(meth.getName(), ret, params); m.makePublic(); Code code = m.getCode(true); code.aload().setThis(); code.constant().setValue(true); code.invokestatic().setMethod(Proxies.class, "dirty", void.class, new Class[] { Proxy.class, boolean.class }); code.aload().setThis(); for (int i = 0; i < params.length; i++) code.xload().setParam(i).setType(params[i]); code.invokespecial().setMethod(type, meth.getName(), ret, params); code.xreturn().setType(ret); code.calculateMaxStack(); code.calculateMaxLocals(); }
/** * Create pass-through constructors to base type. */ private void delegateConstructors(BCClass bc, Class type) { Constructor[] cons = type.getConstructors(); Class[] params; BCMethod m; Code code; for (int i = 0; i < cons.length; i++) { params = cons[i].getParameterTypes(); m = bc.declareMethod("<init>", void.class, params); m.makePublic(); code = m.getCode(true); code.aload().setThis(); for (int j = 0; j < params.length; j++) code.xload().setParam(j).setType(params[j]); code.invokespecial().setMethod(cons[i]); code.vreturn(); code.calculateMaxStack(); code.calculateMaxLocals(); } }
/** * Implement the newInstance method. */ private void addFactoryMethod(BCClass bc) { BCMethod method = bc.declareMethod("newInstance", DynamicStorage.class, null); Code code = method.getCode(true); code.anew().setType(bc); code.dup(); code.invokespecial().setMethod(bc.getName(), "<init>", "void", null); code.areturn(); code.calculateMaxLocals(); code.calculateMaxStack(); }