proceed with wildcards separately to raw types: don't abuse erasure which should leave wildcard types as is

This commit is contained in:
Anna.Kozlova
2016-03-24 11:48:06 +01:00
parent 7e622152f3
commit b3f4cc6589
@@ -1162,7 +1162,8 @@ public class ExpectedTypesProvider {
if (className != null && className.startsWith("Log")) {
if (parameterType instanceof PsiClassType) {
PsiType typeArg = PsiUtil.substituteTypeParameter(parameterType, CommonClassNames.JAVA_LANG_CLASS, 0, true);
if (typeArg != null && TypeConversionUtil.erasure(typeArg).equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) {
if (typeArg instanceof PsiWildcardType && !((PsiWildcardType)typeArg).isBounded() ||
typeArg != null && TypeConversionUtil.erasure(typeArg).equalsToText(CommonClassNames.JAVA_LANG_OBJECT)) {
PsiClass placeClass = PsiTreeUtil.getContextOfType(argument, PsiClass.class);
PsiClass classClass = ((PsiClassType)parameterType).resolve();
if (placeClass != null && classClass != null) {