IDEA-1031

This commit is contained in:
Eugene Vigdorchik
2005-03-21 22:15:03 +03:00
parent 9981b800e2
commit eb32bc4e48
2 changed files with 5 additions and 3 deletions
@@ -26,7 +26,9 @@ public class GenericsUtil {
}
public static PsiType getLeastUpperBound(PsiType type1, PsiType type2, PsiManager manager) {
if (type1 instanceof PsiPrimitiveType || type2 instanceof PsiPrimitiveType) return null;
if (TypeConversionUtil.isPrimitiveAndNotNull(type1) || TypeConversionUtil.isPrimitiveAndNotNull(type2)) return null;
if (TypeConversionUtil.isNullType(type1)) return type2;
if (TypeConversionUtil.isNullType(type2)) return type1;
return getLeastUpperBound(type1, type2, new LinkedHashSet<Pair<PsiType, PsiType>>(), manager);
}
@@ -62,9 +62,9 @@ public class PsiConditionalExpressionImpl extends CompositePsiElement implements
return null;
}
else {
if (type1 instanceof PsiPrimitiveType) type1 = ((PsiPrimitiveType)type1).getBoxedType(getManager(), getResolveScope());
if (TypeConversionUtil.isPrimitiveAndNotNull(type1)) type1 = ((PsiPrimitiveType)type1).getBoxedType(getManager(), getResolveScope());
if (type1 == null) return null;
if (type2 instanceof PsiPrimitiveType) type2 = ((PsiPrimitiveType)type2).getBoxedType(getManager(), getResolveScope());
if (TypeConversionUtil.isPrimitiveAndNotNull(type2)) type2 = ((PsiPrimitiveType)type2).getBoxedType(getManager(), getResolveScope());
if (type2 == null) return null;
return GenericsUtil.getLeastUpperBound(type1, type2, getManager());