Skip to content

Commit aee9cd8

Browse files
cushonronshapiro
authored andcommitted
Give parallelStream() the same treatment as stream()
Fixes google#365 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=244264487
1 parent 8bd336a commit aee9cd8

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,8 @@ private static List<Long> handleStream(List<ExpressionTree> parts) {
15641564
return false;
15651565
}
15661566
Name name = getMethodName((MethodInvocationTree) p);
1567-
return Stream.of("stream", "toBuilder").anyMatch(name::contentEquals);
1567+
return Stream.of("stream", "parallelStream", "toBuilder")
1568+
.anyMatch(name::contentEquals);
15681569
})
15691570
.collect(toList());
15701571
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class I365 {
2+
{
3+
return foo____________
4+
.bar__________()
5+
.baz____________()
6+
.parallelStream()
7+
.map(Baz::getId)
8+
.collect(toList());
9+
}
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class I365 {
2+
{
3+
return foo____________.bar__________().baz____________().parallelStream()
4+
.map(Baz::getId)
5+
.collect(toList());
6+
}
7+
}

0 commit comments

Comments
 (0)