if (type1 == type2) {
return true;
}
if (constraints.containsKey(type1)) {
JTypeParameter type1Parameter = (JTypeParameter) type1;
JClassType type2Class = type2;
JClassType type1Bound = constraints.get(type1Parameter);
assert (!occurs(type1Parameter, type1Bound));
if (!typesMatch(type1Bound, type2, constraints)) {
return false;
}
if (type1Bound.isAssignableFrom(type2Class)) {
constraints.put(type1Parameter, type2Class);
}
}
if (type1 == typeOracle.getJavaLangObject()) {
return true;
}
if (type2 == typeOracle.getJavaLangObject()) {
return true;
}
JTypeParameter type1Param = type1.isTypeParameter();
if (type1Param != null) {
// It would be nice to check that type1Param's bound is a match
// for type2, but that can introduce infinite recursions.
return true;
}
JTypeParameter type2Param = type2.isTypeParameter();
if (type2Param != null) {
// It would be nice to check that type1Param's bound is a match
// for type2, but that can introduce infinite recursions.
return true;
}