mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UseBulkOperationInspection: deparenthesize qualifier
This commit is contained in:
+1
-1
@@ -200,7 +200,7 @@ public class UseBulkOperationInspection extends AbstractBaseJavaLocalInspectionT
|
||||
private void register(@NotNull PsiExpression iterable,
|
||||
@NotNull BulkMethodInfo info,
|
||||
@NotNull PsiReferenceExpression methodExpression) {
|
||||
PsiExpression qualifier = ExpressionUtils.getQualifierOrThis(methodExpression);
|
||||
PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(ExpressionUtils.getQualifierOrThis(methodExpression));
|
||||
if (qualifier instanceof PsiThisExpression) {
|
||||
PsiMethod method = PsiTreeUtil.getParentOfType(iterable, PsiMethod.class);
|
||||
// Likely we are inside of the bulk method implementation
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ public class Collect {
|
||||
|
||||
void collectNames(List<Person> persons){
|
||||
List<Person> names = new ArrayList<>();
|
||||
names.addAll(persons);
|
||||
(names).addAll(persons);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ public class Collect {
|
||||
List<Person> names = new ArrayList<>();
|
||||
for(int i = 0; i<persons.size(); i = i + 1) {
|
||||
Person p = persons.get(i);
|
||||
names.<caret>add(p);
|
||||
(names).<caret>add(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user