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
735afdbb
Commit
735afdbb
authored
7 years ago
by
Roman
Browse files
Options
Download
Email Patches
Plain Diff
fix review issues: IDEA-CR-24159
parent
65dd5c52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/java-impl/src/com/intellij/codeInspection/SimplifyStreamApiCallChainsInspection.java
+3
-5
...codeInspection/SimplifyStreamApiCallChainsInspection.java
with
3 additions
and
5 deletions
+3
-5
java/java-impl/src/com/intellij/codeInspection/SimplifyStreamApiCallChainsInspection.java
+
3
-
5
View file @
735afdbb
...
...
@@ -76,8 +76,8 @@ public class SimplifyStreamApiCallChainsInspection extends BaseJavaBatchLocalIns
instanceCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_BASE_STREAM
,
"map"
).
parameterCount
(
1
);
private
static
final
CallMatcher
STREAM_ANY_MATCH
=
instanceCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_BASE_STREAM
,
"anyMatch"
).
parameterCount
(
1
);
private
static
final
CallMatcher
STREAM_RANGE
=
staticCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_INT_STREAM
,
"range"
).
parameter
Count
(
2
);
private
static
final
CallMatcher
INT_
STREAM_RANGE
=
staticCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_INT_STREAM
,
"range"
).
parameter
Types
(
"int"
,
"int"
);
private
static
final
CallMatcher
STREAM_NONE_MATCH
=
instanceCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_BASE_STREAM
,
"noneMatch"
).
parameterCount
(
1
);
private
static
final
CallMatcher
STREAM_ALL_MATCH
=
...
...
@@ -1081,8 +1081,6 @@ public class SimplifyStreamApiCallChainsInspection extends BaseJavaBatchLocalIns
private
static
final
CallMatcher
INT_STREAM_MAP
=
instanceCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_INT_STREAM
,
"map"
,
"mapToLong"
,
"mapToDouble"
,
"mapToObj"
)
.
parameterCount
(
1
);
private
static
final
CallMatcher
INT_STREAM_RANGE
=
staticCall
(
CommonClassNames
.
JAVA_UTIL_STREAM_INT_STREAM
,
"range"
).
parameterTypes
(
"int"
,
"int"
);
private
static
final
CallMatcher
MIN_INT
=
anyOf
(
staticCall
(
CommonClassNames
.
JAVA_LANG_MATH
,
"min"
).
parameterTypes
(
"int"
,
"int"
),
...
...
@@ -1478,7 +1476,7 @@ public class SimplifyStreamApiCallChainsInspection extends BaseJavaBatchLocalIns
@NotNull
static
CallHandler
<
CallChainSimplification
>
handler
()
{
return
CallHandler
.
of
(
STREAM_RANGE
,
call
->
{
return
CallHandler
.
of
(
INT_
STREAM_RANGE
,
call
->
{
PsiExpression
[]
args
=
call
.
getArgumentList
().
getExpressions
();
PsiMethodCallExpression
maybeMap
=
ExpressionUtils
.
getCallForQualifier
(
call
);
if
(!
STREAM_INT_MAP_TO_ALL
.
test
(
maybeMap
))
return
null
;
...
...
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