public String commonSuperType(String oa, String ob) throws ClassMirrorNotFoundException {
String a = toClassName(oa);
String b = toClassName(ob);
try {
ClassMirror ca = mirrors.classForName(a);
ClassMirror cb = mirrors.classForName(b);
if (ca.isAssignableFrom(cb)) return oa;
if (cb.isAssignableFrom(ca)) return ob;
if (ca.isInterface() && cb.isInterface()) {
return D_OBJECT; // This is what the java bytecode verifier does
}
} catch (ClassMirrorNotFoundException e) {
// try to see if the below works...
}