public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Make sure the outer class name is kept as well. classConstant.referencedClassAccept(this); }
/** * Explicitly adds a new class constant for the given class in the given * program class. */ private int addNewClassConstant(ProgramClass programClass, String className, Clazz referencedClass) { ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(programClass); int nameIndex = constantPoolEditor.addUtf8Constant(className); int classConstantIndex = constantPoolEditor.addConstant(new ClassConstant(nameIndex, referencedClass)); return classConstantIndex; } }
/** * Explicitly adds a new class constant for the given class in the given * program class. */ private int addNewClassConstant(ProgramClass programClass, String className, Clazz referencedClass) { ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(programClass); int nameIndex = constantPoolEditor.addUtf8Constant(className); int classConstantIndex = constantPoolEditor.addConstant(new ClassConstant(nameIndex, referencedClass)); return classConstantIndex; } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Check if this is an interface class. classConstant.referencedClassAccept(this); }
/** * Explicitly adds a new class constant for the given class in the given * program class. */ private int addNewClassConstant(ProgramClass programClass, String className, Clazz referencedClass) { ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(programClass); int nameIndex = constantPoolEditor.addUtf8Constant(className); int classConstantIndex = constantPoolEditor.addConstant(new ClassConstant(nameIndex, referencedClass)); return classConstantIndex; } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Let the visitor visit the class referenced in the class constant. classConstant.referencedClassAccept(classVisitor); }
/** * Explicitly adds a new class constant for the given class in the given * program class. */ private int addNewClassConstant(ProgramClass programClass, String className, Clazz referencedClass) { ConstantPoolEditor constantPoolEditor = new ConstantPoolEditor(programClass); int nameIndex = constantPoolEditor.addUtf8Constant(className); int classConstantIndex = constantPoolEditor.addConstant(new ClassConstant(nameIndex, referencedClass)); return classConstantIndex; } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Make sure the outer class has a name. classConstant.referencedClassAccept(this); }
private Constant createConstant() { int u1tag = dataInput.readUnsignedByte(); switch (u1tag) { case ClassConstants.CONSTANT_Utf8: return new Utf8Constant(); case ClassConstants.CONSTANT_Integer: return new IntegerConstant(); case ClassConstants.CONSTANT_Float: return new FloatConstant(); case ClassConstants.CONSTANT_Long: return new LongConstant(); case ClassConstants.CONSTANT_Double: return new DoubleConstant(); case ClassConstants.CONSTANT_String: return new StringConstant(); case ClassConstants.CONSTANT_Fieldref: return new FieldrefConstant(); case ClassConstants.CONSTANT_Methodref: return new MethodrefConstant(); case ClassConstants.CONSTANT_InterfaceMethodref: return new InterfaceMethodrefConstant(); case ClassConstants.CONSTANT_Class: return new ClassConstant(); case ClassConstants.CONSTANT_NameAndType: return new NameAndTypeConstant(); default: throw new RuntimeException("Unknown constant type ["+u1tag+"] in constant pool"); } }
public boolean isMethodHandleClass(ClassConstant classConstant, Clazz clazz) { return classConstant != null && classConstant.getName(clazz).startsWith(METHOD_HANDLES_CLASS); } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Is the constant referring to a wrapper class? classConstant.referencedClassAccept(this); }
private Constant createConstant() { int u1tag = dataInput.readUnsignedByte(); switch (u1tag) { case ClassConstants.CONSTANT_Utf8: return new Utf8Constant(); case ClassConstants.CONSTANT_Integer: return new IntegerConstant(); case ClassConstants.CONSTANT_Float: return new FloatConstant(); case ClassConstants.CONSTANT_Long: return new LongConstant(); case ClassConstants.CONSTANT_Double: return new DoubleConstant(); case ClassConstants.CONSTANT_String: return new StringConstant(); case ClassConstants.CONSTANT_Fieldref: return new FieldrefConstant(); case ClassConstants.CONSTANT_Methodref: return new MethodrefConstant(); case ClassConstants.CONSTANT_InterfaceMethodref: return new InterfaceMethodrefConstant(); case ClassConstants.CONSTANT_Class: return new ClassConstant(); case ClassConstants.CONSTANT_NameAndType: return new NameAndTypeConstant(); default: throw new RuntimeException("Unknown constant type ["+u1tag+"] in constant pool"); } }
public boolean isMethodHandleClass(ClassConstant classConstant, Clazz clazz) { return classConstant != null && classConstant.getName(clazz).startsWith(METHOD_HANDLES_CLASS); } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Visit the referenced class from the .class construct. classConstant.referencedClassAccept(classVisitor); } }
public boolean isMethodHandleClass(ClassConstant classConstant, Clazz clazz) { return classConstant != null && classConstant.getName(clazz).startsWith(METHOD_HANDLES_CLASS); } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Check the referenced class. classConstant.referencedClassAccept(this); }