File tree Expand file tree Collapse file tree
java-analysis-impl/src/main/java/com/intellij/java/analysis/impl/codeInsight/daemon/impl/analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import jakarta .annotation .Nonnull ;
2727
2828public class PsiMethodReferenceHighlightingUtil {
29- public static HighlightInfo checkRawConstructorReference (@ Nonnull PsiMethodReferenceExpression expression ) {
30- if (expression .isConstructor ()) {
31- PsiType [] typeParameters = expression .getTypeParameters ();
32- if (typeParameters .length > 0 ) {
33- PsiElement qualifier = expression .getQualifier ();
34- if (qualifier instanceof PsiReferenceExpression ) {
35- PsiElement resolve = ((PsiReferenceExpression ) qualifier ).resolve ();
36- if (resolve instanceof PsiClass && ((PsiClass ) resolve ).hasTypeParameters ()) {
37- return HighlightInfo .newHighlightInfo (HighlightInfoType .ERROR ).range (expression )
38- .descriptionAndTooltip ("Raw constructor reference with explicit type parameters for " +
39- "constructor" ).create ();
40- }
29+ public static HighlightInfo checkRawConstructorReference (@ Nonnull PsiMethodReferenceExpression expression ) {
30+ if (expression .isConstructor ()) {
31+ PsiType [] typeParameters = expression .getTypeParameters ();
32+ if (typeParameters .length > 0 ) {
33+ PsiElement qualifier = expression .getQualifier ();
34+ if (qualifier instanceof PsiReferenceExpression ) {
35+ PsiElement resolve = ((PsiReferenceExpression )qualifier ).resolve ();
36+ if (resolve instanceof PsiClass && ((PsiClass )resolve ).hasTypeParameters ()) {
37+ return HighlightInfo .newHighlightInfo (HighlightInfoType .ERROR )
38+ .range (expression )
39+ .descriptionAndTooltip ("Raw constructor reference with explicit type parameters for constructor" )
40+ .create ();
41+ }
42+ }
43+ }
4144 }
42- }
45+ return null ;
4346 }
44- return null ;
45- }
4647}
You can’t perform that action at this time.
0 commit comments