void (boolean statementPosition) { if (isExpressionPosition(myPosition)) { PsiElement parent = myPosition.getParent(); PsiElement grandParent = parent == null ? null : parent.getParent(); boolean allowExprKeywords = !(grandParent instanceof PsiExpressionStatement) && !(grandParent instanceof PsiUnaryExpression); if (PsiTreeUtil.getParentOfType(myPosition, PsiAnnotation.class) == null) { if (!statementPosition) { addKeyword(TailTypeDecorator.withTail(createKeyword(PsiKeyword.NEW), TailTypes.insertSpaceType())); if (HighlightingFeature.ENHANCED_SWITCH.isAvailable(myPosition)) { addKeyword(new OverridableSpace(createKeyword(PsiKeyword.SWITCH), JavaTailTypes.SWITCH_LPARENTH)); } } if (allowExprKeywords) { addKeyword(createKeyword(PsiKeyword.NULL)); } } if (allowExprKeywords && mayExpectBoolean(myParameters)) { addKeyword(createKeyword(PsiKeyword.TRUE)); addKeyword(createKeyword(PsiKeyword.FALSE)); } } if (isQualifiedNewContext()) { addKeyword(createKeyword(PsiKeyword.NEW)); } }