From b3f4cc65894b1ef2f8e0c72afa504b4fb6646fc1 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Thu, 24 Mar 2016 11:05:41 +0100 Subject: [PATCH] proceed with wildcards separately to raw types: don't abuse erasure which should leave wildcard types as is --- .../src/com/intellij/codeInsight/ExpectedTypesProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/ExpectedTypesProvider.java b/java/java-impl/src/com/intellij/codeInsight/ExpectedTypesProvider.java index 212918e4195d..fb7460d581f9 100644 --- a/java/java-impl/src/com/intellij/codeInsight/ExpectedTypesProvider.java +++ b/java/java-impl/src/com/intellij/codeInsight/ExpectedTypesProvider.java @@ -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) {