System.out.println(" -> "+newName);
System.out.println(" Method descriptor = "+descriptor);
System.out.println(" -> "+newDescriptor);
}
ConstantPoolEditor constantPoolEditor =
new ConstantPoolEditor(programClass);
// Update the name, if necessary.
if (!newName.equals(name))
{
programMethod.u2nameIndex =
constantPoolEditor.addUtf8Constant(newName);
}
// Update the referenced classes.
programMethod.referencedClasses =
shrinkReferencedClasses(programMethod,
descriptor,
programMethod.referencedClasses);
// Finally, update the descriptor itself.
programMethod.u2descriptorIndex =
constantPoolEditor.addUtf8Constant(newDescriptor);
// Visit the method, if required.
if (extraMemberVisitor != null)
{
extraMemberVisitor.visitProgramMethod(programClass, programMethod);