/** * Creates a new BootstrapMethodInfoAdder that will copy bootstrap methods * into the given bootstrap methods attribute. */ public BootstrapMethodInfoAdder(ProgramClass targetClass, BootstrapMethodsAttribute targetBootstrapMethodsAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.bootstrapMethodsAttributeEditor = new BootstrapMethodsAttributeEditor(targetBootstrapMethodsAttribute); }
/** * Removes the given bootstrap method from the bootstrap method attribute. */ public void removeBootstrapMethodInfo(BootstrapMethodInfo bootstrapMethodInfo) { ArrayUtil.remove(targetBootstrapMethodsAttribute.bootstrapMethods, targetBootstrapMethodsAttribute.u2bootstrapMethodsCount--, findBootstrapMethodInfoIndex(bootstrapMethodInfo)); }
public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo) { // Copy the method arguments. int methodArgumentCount = bootstrapMethodInfo.u2methodArgumentCount; int[] methodArguments = bootstrapMethodInfo.u2methodArguments; int[] newMethodArguments = new int[methodArgumentCount]; for (int index = 0; index < methodArgumentCount; index++) { newMethodArguments[index] = constantAdder.addConstant(clazz, methodArguments[index]); } // Create a new bootstrap method. BootstrapMethodInfo newBootstrapMethodInfo = new BootstrapMethodInfo(constantAdder.addConstant(clazz, bootstrapMethodInfo.u2methodHandleIndex), methodArgumentCount, newMethodArguments); // Add it to the target. bootstrapMethodIndex = bootstrapMethodsAttributeEditor.addBootstrapMethodInfo(newBootstrapMethodInfo); } }
public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo) { // Copy the method arguments. int methodArgumentCount = bootstrapMethodInfo.u2methodArgumentCount; int[] methodArguments = bootstrapMethodInfo.u2methodArguments; int[] newMethodArguments = new int[methodArgumentCount]; for (int index = 0; index < methodArgumentCount; index++) { newMethodArguments[index] = constantAdder.addConstant(clazz, methodArguments[index]); } // Create a new bootstrap method. BootstrapMethodInfo newBootstrapMethodInfo = new BootstrapMethodInfo(constantAdder.addConstant(clazz, bootstrapMethodInfo.u2methodHandleIndex), methodArgumentCount, newMethodArguments); // Add it to the target. bootstrapMethodIndex = bootstrapMethodsAttributeEditor.addBootstrapMethodInfo(newBootstrapMethodInfo); } }
/** * Creates a new BootstrapMethodInfoAdder that will copy bootstrap methods * into the given bootstrap methods attribute. */ public BootstrapMethodInfoAdder(ProgramClass targetClass, BootstrapMethodsAttribute targetBootstrapMethodsAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.bootstrapMethodsAttributeEditor = new BootstrapMethodsAttributeEditor(targetBootstrapMethodsAttribute); }
/** * Removes the given bootstrap method from the bootstrap method attribute. */ public void removeBootstrapMethodInfo(BootstrapMethodInfo bootstrapMethodInfo) { ArrayUtil.remove(targetBootstrapMethodsAttribute.bootstrapMethods, targetBootstrapMethodsAttribute.u2bootstrapMethodsCount--, findBootstrapMethodInfoIndex(bootstrapMethodInfo)); }
public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo) { // Copy the method arguments. int methodArgumentCount = bootstrapMethodInfo.u2methodArgumentCount; int[] methodArguments = bootstrapMethodInfo.u2methodArguments; int[] newMethodArguments = new int[methodArgumentCount]; for (int index = 0; index < methodArgumentCount; index++) { newMethodArguments[index] = constantAdder.addConstant(clazz, methodArguments[index]); } // Create a new bootstrap method. BootstrapMethodInfo newBootstrapMethodInfo = new BootstrapMethodInfo(constantAdder.addConstant(clazz, bootstrapMethodInfo.u2methodHandleIndex), methodArgumentCount, newMethodArguments); // Add it to the target. bootstrapMethodIndex = bootstrapMethodsAttributeEditor.addBootstrapMethodInfo(newBootstrapMethodInfo); } }
/** * Creates a new BootstrapMethodInfoAdder that will copy bootstrap methods * into the given bootstrap methods attribute. */ public BootstrapMethodInfoAdder(ProgramClass targetClass, BootstrapMethodsAttribute targetBootstrapMethodsAttribute) { this.constantAdder = new ConstantAdder(targetClass); this.bootstrapMethodsAttributeEditor = new BootstrapMethodsAttributeEditor(targetBootstrapMethodsAttribute); }
/** * Removes the given bootstrap method from the bootstrap method attribute. */ public void removeBootstrapMethodInfo(BootstrapMethodInfo bootstrapMethodInfo) { ArrayUtil.remove(targetBootstrapMethodsAttribute.bootstrapMethods, targetBootstrapMethodsAttribute.u2bootstrapMethodsCount--, findBootstrapMethodInfoIndex(bootstrapMethodInfo)); }