} else {
// Can't say anything?
return;
}
SootClass checkClass = (checkRef).getSootClass();
SootClass opClass = (opRef).getSootClass();
if (debug) {
System.out.println("checkClass = " + checkClass);
}
if (debug) {
System.out.println("opClass = " + opClass);
}
if (checkClass.isInterface()) {
if (opClass.isInterface()) {
if (hierarchy.isInterfaceSubinterfaceOf(opClass, checkClass)
|| opClass.equals(checkClass)) {
// Then we know the instanceof will be true.
if (debug) {
System.out.println("Replacing " + box.getValue()
+ " with true.");
}
box.setValue(IntConstant.v(1));
}
} else {
// opClass is a class, not an interface.
List implementorList = hierarchy.getImplementersOf(checkClass);
if (implementorList.contains(opClass)) {
// Then we know the instanceof will be true.
if (debug) {
System.out.println("Replacing " + box.getValue()
+ " with true.");
}
box.setValue(IntConstant.v(1));
} else {
// We need to ensure that no subclass
// of opclass implements the
// interface. This will mean we
// replace with false.
boolean foundOne = false;
for (Iterator implementors = implementorList.iterator(); implementors
.hasNext()
&& !foundOne;) {
SootClass implementor = (SootClass) implementors.next();
if (hierarchy.getSuperclassesOf(implementor).contains(
opClass)) {
foundOne = true;
}