void (@NotNull PsiNewExpression expression) { PsiType type = expression.getType(); PsiClass aClass = PsiUtil.resolveClassInType(type); add(HighlightUtil.checkUnhandledExceptions(expression)); if (!hasErrorResults()) add(HighlightClassUtil.checkAnonymousInheritFinal(expression)); if (!hasErrorResults()) add(HighlightClassUtil.checkAnonymousInheritProhibited(expression)); if (!hasErrorResults()) add(HighlightClassUtil.checkAnonymousSealedProhibited(expression)); if (!hasErrorResults()) add(HighlightClassUtil.checkQualifiedNew(expression, type, aClass)); if (aClass != null && !hasErrorResults()) { add(HighlightClassUtil.checkCreateInnerClassFromStaticContext(expression, type, aClass)); } if (!hasErrorResults()) add(GenericsHighlightUtil.checkTypeParameterInstantiation(expression)); if (aClass != null && !hasErrorResults()) add(HighlightClassUtil.checkInstantiationOfAbstractClass(aClass, expression)); if (!hasErrorResults()) add(GenericsHighlightUtil.checkEnumInstantiation(expression, aClass)); if (!hasErrorResults()) add(GenericsHighlightUtil.checkGenericArrayCreation(expression, type)); if (!hasErrorResults()) registerConstructorCall(expression); try { if (!hasErrorResults()) HighlightMethodUtil.checkNewExpression(getProject(), expression, type, myJavaSdkVersion, myErrorSink); } catch (IndexNotReadyException ignored) { } if (!hasErrorResults()) visitExpression(expression); if (!hasErrorResults()) { HighlightingFeature.checkPreviewFeature(expression, myPreviewFeatureVisitor); } }