}
@Override
public void visit(JavaClass obj) {
compute();
ConstantPool cp = obj.getConstantPool();
Constant[] constants = cp.getConstantPool();
checkConstant: for (int i = 0; i < constants.length; i++) {
Constant co = constants[i];
if (co instanceof ConstantDouble || co instanceof ConstantLong) {
i++;
}
if (co instanceof ConstantClass) {
String ref = getClassName(obj, i);
if ((ref.startsWith("java") || ref.startsWith("org.w3c.dom")) && !defined.contains(ref)) {
bugReporter.reportBug(new BugInstance(this, "VR_UNRESOLVABLE_REFERENCE", NORMAL_PRIORITY).addClass(obj)
.addString(ref));
}
} else if (co instanceof ConstantFieldref) {
// do nothing until we handle static fields defined in
// interfaces
} else if (co instanceof ConstantCP) {
ConstantCP co2 = (ConstantCP) co;
String className = getClassName(obj, co2.getClassIndex());
// System.out.println("checking " + ref);
if (className.equals(obj.getClassName()) || !defined.contains(className)) {
// System.out.println("Skipping check of " + ref);
continue checkConstant;
}
ConstantNameAndType nt = (ConstantNameAndType) cp.getConstant(co2.getNameAndTypeIndex());
String name = ((ConstantUtf8) obj.getConstantPool().getConstant(nt.getNameIndex(), CONSTANT_Utf8)).getBytes();
String signature = ((ConstantUtf8) obj.getConstantPool().getConstant(nt.getSignatureIndex(), CONSTANT_Utf8))
.getBytes();
try {