mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Java9CollectionFactoryInspection: cleanup
This commit is contained in:
+2
-4
@@ -271,7 +271,7 @@ public class Java9CollectionFactoryInspection extends BaseLocalInspectionTool {
|
||||
PsiExpression[] args = argumentList.getExpressions();
|
||||
PsiJavaCodeReferenceElement classReference = newExpression.getClassReference();
|
||||
if (classReference != null && className.equals(classReference.getQualifiedName())) {
|
||||
return fromCopyConstructor(newExpression, args, type);
|
||||
return fromCopyConstructor(args, type);
|
||||
}
|
||||
PsiAnonymousClass anonymousClass = newExpression.getAnonymousClass();
|
||||
if (anonymousClass != null && args.length == 0) {
|
||||
@@ -285,9 +285,7 @@ public class Java9CollectionFactoryInspection extends BaseLocalInspectionTool {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static PrepopulatedCollectionModel fromCopyConstructor(PsiNewExpression newExpression,
|
||||
PsiExpression[] args,
|
||||
String type) {
|
||||
private static PrepopulatedCollectionModel fromCopyConstructor(PsiExpression[] args, String type) {
|
||||
if (args.length == 1) {
|
||||
PsiExpression arg = PsiUtil.skipParenthesizedExprDown(args[0]);
|
||||
PsiMethodCallExpression call = tryCast(arg, PsiMethodCallExpression.class);
|
||||
|
||||
Reference in New Issue
Block a user