--- old/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java 2020-01-16 18:02:36.556171999 +0000 +++ new/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/FieldOrMethod.java 2020-01-16 18:02:36.062159864 +0000 @@ -31,7 +31,6 @@ * Super class for InvokeInstruction and FieldInstruction, since they have * some methods in common! * - * @version $Id$ */ public abstract class FieldOrMethod extends CPInstruction implements LoadClass { @@ -40,6 +39,7 @@ * Not to be used otherwise. */ FieldOrMethod() { + // no init } @@ -53,7 +53,7 @@ /** @return signature of referenced method/field. */ - public String getSignature( final ConstantPoolGen cpg ) { + public String getSignature(final ConstantPoolGen cpg) { final ConstantPool cp = cpg.getConstantPool(); final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex()); final ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex()); @@ -63,7 +63,7 @@ /** @return name of referenced method/field. */ - public String getName( final ConstantPoolGen cpg ) { + public String getName(final ConstantPoolGen cpg) { final ConstantPool cp = cpg.getConstantPool(); final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex()); final ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex()); @@ -83,7 +83,7 @@ * */ @Deprecated - public String getClassName( final ConstantPoolGen cpg ) { + public String getClassName(final ConstantPoolGen cpg) { final ConstantPool cp = cpg.getConstantPool(); final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex()); final String className = cp.getConstantString(cmr.getClassIndex(), Const.CONSTANT_Class); @@ -101,20 +101,20 @@ * getReferenceType() instead. */ @Deprecated - public ObjectType getClassType( final ConstantPoolGen cpg ) { + public ObjectType getClassType(final ConstantPoolGen cpg) { return ObjectType.getInstance(getClassName(cpg)); } /** - * Return the reference type representing the class, interface, + * Gets the reference type representing the class, interface, * or array class referenced by the instruction. * @param cpg the ConstantPoolGen used to create the instruction * @return an ObjectType (if the referenced class type is a class * or interface), or an ArrayType (if the referenced class * type is an array class) */ - public ReferenceType getReferenceType( final ConstantPoolGen cpg ) { + public ReferenceType getReferenceType(final ConstantPoolGen cpg) { final ConstantPool cp = cpg.getConstantPool(); final ConstantCP cmr = (ConstantCP) cp.getConstant(super.getIndex()); String className = cp.getConstantString(cmr.getClassIndex(), Const.CONSTANT_Class); @@ -127,17 +127,18 @@ /** - * Get the ObjectType of the method return or field. + * Gets the ObjectType of the method return or field. * * @return type of the referenced class/interface * @throws ClassGenException when the field is (or method returns) an array, */ @Override - public ObjectType getLoadClassType( final ConstantPoolGen cpg ) { + public ObjectType getLoadClassType(final ConstantPoolGen cpg) { final ReferenceType rt = getReferenceType(cpg); - if(rt instanceof ObjectType) { - return (ObjectType)rt; + if (rt instanceof ObjectType) { + return (ObjectType) rt; } - throw new ClassGenException(rt.getSignature() + " does not represent an ObjectType"); + throw new ClassGenException(rt.getClass().getCanonicalName() + " " + + rt.getSignature() + " does not represent an ObjectType"); } }