@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { if (Modifier.isPrivate(classMethod.getAccessFlags())) { // Weld cannot use invokespecial to invoke a private method from the superclass invokePrivateMethodHandler(b, classMethod, methodInfo, staticConstructor); } else { // build the bytecode that invokes the super class method directly b.aload(0); // create the method invocation b.loadMethodParameters(); b.invokespecial(methodInfo.getDeclaringClass(), methodInfo.getName(), methodInfo.getDescriptor()); } // leave the result on top of the stack }
private void createAbstractMethodCode(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor) { if ((delegateField != null) && (!Modifier.isPrivate(delegateField.getModifiers()))) { // Call the corresponding method directly on the delegate final CodeAttribute b = classMethod.getCodeAttribute(); // load the delegate field b.aload(0); b.getfield(classMethod.getClassFile().getName(), delegateField.getName(), DescriptorUtils.makeDescriptor(delegateField.getType())); // load the parameters b.loadMethodParameters(); // invoke the delegate method b.invokeinterface(delegateField.getType().getName(), method.getName(), method.getDescriptor()); // return the value if applicable b.returnInstruction(); } else { if (!Modifier.isPrivate(method.getMethod().getModifiers())) { // if it is a parameter injection point we need to initialize the // injection point then handle the method with the method handler // this is slightly different to a normal method handler call, as we pass // in a TargetInstanceBytecodeMethodResolver. This resolver uses the // method handler to call getTargetClass to get the correct class type to // resolve the method with, and then resolves this method invokeMethodHandler(classMethod, method, true, targetInstanceBytecodeMethodResolver, staticConstructor); } else { // if the delegate is private we need to use the method handler createInterceptorBody(classMethod, method, staticConstructor); } } }
private void createAbstractMethodCode(ClassMethod classMethod, MethodInformation method, ClassMethod staticConstructor) { if ((delegateField != null) && (!Modifier.isPrivate(delegateField.getModifiers()))) { // Call the corresponding method directly on the delegate final CodeAttribute b = classMethod.getCodeAttribute(); // load the delegate field b.aload(0); b.getfield(classMethod.getClassFile().getName(), delegateField.getName(), DescriptorUtils.makeDescriptor(delegateField.getType())); // load the parameters b.loadMethodParameters(); // invoke the delegate method b.invokeinterface(delegateField.getType().getName(), method.getName(), method.getDescriptor()); // return the value if applicable b.returnInstruction(); } else { if (!Modifier.isPrivate(method.getMethod().getModifiers())) { // if it is a parameter injection point we need to initialize the // injection point then handle the method with the method handler // this is slightly different to a normal method handler call, as we pass // in a TargetInstanceBytecodeMethodResolver. This resolver uses the // method handler to call getTargetClass to get the correct class type to // resolve the method with, and then resolves this method invokeMethodHandler(classMethod, method, true, targetInstanceBytecodeMethodResolver, staticConstructor); } else { // if the delegate is private we need to use the method handler createInterceptorBody(classMethod, method, staticConstructor); } } }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }
@Override void doWork(CodeAttribute b, ClassMethod classMethod) { loadBeanInstance(classMethod.getClassFile(), methodInfo, b); //now we should have the target bean instance on top of the stack // we need to dup it so we still have it to compare to the return value b.dup(); //lets create the method invocation String methodDescriptor = methodInfo.getDescriptor(); b.loadMethodParameters(); if (method.getDeclaringClass().isInterface()) { b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } else { b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); } }
private void createDelegateToSuper(ClassMethod classMethod, MethodInformation method, String className) { CodeAttribute b = classMethod.getCodeAttribute(); // first generate the invokespecial call to the super class method b.aload(0); b.loadMethodParameters(); b.invokespecial(className, method.getName(), method.getDescriptor()); b.returnInstruction(); }