Package proguard.classfile.editor
Class BootstrapMethodsAttributeShrinker
- java.lang.Object
-
- proguard.classfile.editor.BootstrapMethodsAttributeShrinker
-
- All Implemented Interfaces:
AttributeVisitor
,BootstrapMethodInfoVisitor
,InstructionVisitor
,ClassVisitor
,MemberVisitor
public class BootstrapMethodsAttributeShrinker extends java.lang.Object implements ClassVisitor, MemberVisitor, AttributeVisitor, InstructionVisitor, BootstrapMethodInfoVisitor
ThisClassVisitor
removes all unused entries from the bootstrap method attribute.If all bootstrap methods are removed, it also removes the
BootstrapMethodsAttribute
from the visited class. Additionally, thejava/lang/MethodHandles$Lookup
class will be removed from theInnerClassesAttribute
, and theInnerClassesAttribute
will be removed if it was the only entry.
-
-
Constructor Summary
Constructors Constructor Description BootstrapMethodsAttributeShrinker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
visitAnyAttribute(Clazz clazz, Attribute attribute)
Visits any Attribute instance.void
visitAnyClass(Clazz clazz)
Visits any Clazz instance.void
visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
Visits any Instruction instance.void
visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo)
void
visitBootstrapMethodsAttribute(Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute)
void
visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
void
visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
void
visitProgramClass(ProgramClass programClass)
void
visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface proguard.classfile.attribute.visitor.AttributeVisitor
visitAnnotationDefaultAttribute, visitAnyAnnotationsAttribute, visitAnyParameterAnnotationsAttribute, visitAnyTypeAnnotationsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitMethodParametersAttribute, visitModuleAttribute, visitModuleMainClassAttribute, visitModulePackagesAttribute, visitNestHostAttribute, visitNestMembersAttribute, visitPermittedSubclassesAttribute, visitRecordAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDebugExtensionAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttribute
-
Methods inherited from interface proguard.classfile.visitor.ClassVisitor
visitLibraryClass
-
Methods inherited from interface proguard.classfile.instruction.visitor.InstructionVisitor
visitAnySwitchInstruction, visitBranchInstruction, visitLookUpSwitchInstruction, visitSimpleInstruction, visitTableSwitchInstruction, visitVariableInstruction
-
Methods inherited from interface proguard.classfile.visitor.MemberVisitor
visitAnyMember, visitLibraryField, visitLibraryMember, visitLibraryMethod, visitProgramField, visitProgramMember
-
-
-
-
Method Detail
-
visitAnyClass
public void visitAnyClass(Clazz clazz)
Description copied from interface:ClassVisitor
Visits any Clazz instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyClass
in interfaceClassVisitor
-
visitProgramClass
public void visitProgramClass(ProgramClass programClass)
- Specified by:
visitProgramClass
in interfaceClassVisitor
-
visitProgramMethod
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
- Specified by:
visitProgramMethod
in interfaceMemberVisitor
-
visitAnyAttribute
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
Description copied from interface:AttributeVisitor
Visits any Attribute instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyAttribute
in interfaceAttributeVisitor
-
visitCodeAttribute
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
- Specified by:
visitCodeAttribute
in interfaceAttributeVisitor
-
visitBootstrapMethodsAttribute
public void visitBootstrapMethodsAttribute(Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute)
- Specified by:
visitBootstrapMethodsAttribute
in interfaceAttributeVisitor
-
visitAnyInstruction
public void visitAnyInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, Instruction instruction)
Description copied from interface:InstructionVisitor
Visits any Instruction instance. The more specific default implementations of this interface delegate to this method.- Specified by:
visitAnyInstruction
in interfaceInstructionVisitor
-
visitConstantInstruction
public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
- Specified by:
visitConstantInstruction
in interfaceInstructionVisitor
-
visitBootstrapMethodInfo
public void visitBootstrapMethodInfo(Clazz clazz, BootstrapMethodInfo bootstrapMethodInfo)
- Specified by:
visitBootstrapMethodInfo
in interfaceBootstrapMethodInfoVisitor
-
-