diff --git a/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java b/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java index 9f5c265cec82..18050b94b35c 100644 --- a/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java +++ b/java/java-impl/src/com/intellij/codeInsight/lookup/PsiTypeLookupItem.java @@ -78,6 +78,9 @@ public class PsiTypeLookupItem extends LookupItem { PostprocessReformattingAspect.getInstance(context.getProject()).doPostponedFormatting(); int tail = context.getTailOffset(); + if (tail <= 0) { + return; + } String braces = StringUtil.repeat("[]", getBracketsCount()); Editor editor = context.getEditor(); if (!braces.isEmpty()) {