diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java index d518e8413b3c..1939ef31d060 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java @@ -654,14 +654,19 @@ public class JavaCompletionContributor extends CompletionContributor { PsiType type = expectedTypes.size() == 1 ? expectedTypes.iterator().next() : null; if (type != null) { final PsiType deepComponentType = type.getDeepComponentType(); + String expectedType = type.getPresentableText(); + if (expectedType.contains(CompletionUtil.DUMMY_IDENTIFIER_TRIMMED)) { + return null; + } + if (deepComponentType instanceof PsiClassType) { if (((PsiClassType)deepComponentType).resolve() != null) { - return CompletionBundle.message("completion.no.suggestions.of.type", type.getPresentableText()) + suffix; + return CompletionBundle.message("completion.no.suggestions.of.type", expectedType) + suffix; } - return CompletionBundle.message("completion.unknown.type", type.getPresentableText()) + suffix; + return CompletionBundle.message("completion.unknown.type", expectedType) + suffix; } if (!PsiType.NULL.equals(type)) { - return CompletionBundle.message("completion.no.suggestions.of.type", type.getPresentableText()) + suffix; + return CompletionBundle.message("completion.no.suggestions.of.type", expectedType) + suffix; } } }