mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-86760 Find usages detects array initialization as new instance creation fixed
This commit is contained in:
@@ -227,7 +227,7 @@ public class JavaUsageTypeProvider implements UsageTypeProviderEx {
|
||||
if (isInnerClassOf(classReference, targets)) {
|
||||
return UsageType.CLASS_INNER_NEW_OPERATOR;
|
||||
}
|
||||
if (psiNewExpression.getArrayDimensions().length > 0) {
|
||||
if (isNewArrayCreation(psiNewExpression)) {
|
||||
return UsageType.CLASS_NEW_ARRAY;
|
||||
}
|
||||
return UsageType.CLASS_NEW_OPERATOR;
|
||||
@@ -237,6 +237,10 @@ public class JavaUsageTypeProvider implements UsageTypeProviderEx {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isNewArrayCreation(@NotNull PsiNewExpression expression){
|
||||
return expression.getArrayDimensions().length > 0 || expression.getArrayInitializer() != null;
|
||||
}
|
||||
|
||||
private static boolean isAnonymousClassOf(@Nullable PsiAnonymousClass anonymousClass, @NotNull UsageTarget[] targets) {
|
||||
if (anonymousClass == null) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user