c.dupX1(); c.swap(); c.invokespecial(HTTP_STRING_CLASS, "<init>", "(Ljava/lang/String;)V");
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
@Override void doReturn(CodeAttribute b, ClassMethod classMethod) { // assumes doWork() result is on top of the stack // if this method returns a primitive we just return if (method.getReturnType().isPrimitive()) { b.returnInstruction(); } else { // otherwise we have to check that the proxy is not returning 'this; // now we need to check if the proxy has return 'this' and if so return // an // instance of the proxy. // currently we have result, beanInstance on the stack. b.dupX1(); // now we have result, beanInstance, result // we need to compare result and beanInstance // first we need to build up the inner conditional that just returns // the // result final BranchEnd returnInstruction = b.ifAcmpeq(); b.returnInstruction(); b.branchEnd(returnInstruction); // now add the case where the proxy returns 'this'; b.aload(0); b.checkcast(methodInfo.getMethod().getReturnType().getName()); b.returnInstruction(); } } }.runStartIfNotEmpty();
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);
b.dupX1(); // Handler, Stack -> Stack, Handler, Stack b.invokevirtual(COMBINED_INTERCEPTOR_AND_DECORATOR_STACK_METHOD_HANDLER_CLASS_NAME, "isDisabledHandler", "(" + DescriptorUtils.makeDescriptor(Stack.class) + ")" + BytecodeUtils.BOOLEAN_CLASS_DESCRIPTOR);