Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
b44aed3b
Commit
b44aed3b
authored
6 years ago
by
Tagir Valeev
Browse files
Options
Download
Email Patches
Plain Diff
UseBulkOperationInspection: deparenthesize qualifier
parent
f1f118cc
Branches unavailable
Tags unavailable
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
java/java-impl/src/com/intellij/codeInspection/bulkOperation/UseBulkOperationInspection.java
+1
-1
...eInspection/bulkOperation/UseBulkOperationInspection.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/useBulkOperation/afterAddAllIndexed.java
+1
-1
...nalyzer/quickFix/useBulkOperation/afterAddAllIndexed.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/useBulkOperation/beforeAddAllIndexed.java
+1
-1
...alyzer/quickFix/useBulkOperation/beforeAddAllIndexed.java
with
3 additions
and
3 deletions
+3
-3
java/java-impl/src/com/intellij/codeInspection/bulkOperation/UseBulkOperationInspection.java
+
1
-
1
View file @
b44aed3b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/useBulkOperation/afterAddAllIndexed.java
+
1
-
1
View file @
b44aed3b
...
...
@@ -6,6 +6,6 @@ public class Collect {
void
collectNames
(
List
<
Person
>
persons
){
List
<
Person
>
names
=
new
ArrayList
<>();
names
.
addAll
(
persons
);
(
names
)
.
addAll
(
persons
);
}
}
This diff is collapsed.
Click to expand it.
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/useBulkOperation/beforeAddAllIndexed.java
+
1
-
1
View file @
b44aed3b
...
...
@@ -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
);
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help