-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when breaking up long comment after simple lambda body (#203)
Make lambda/assignment logic more resilient so it doesn't crash when encountering long comments.
- Loading branch information
1 parent
0f9157e
commit 58fb486
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: fix | ||
fix: | ||
description: Make lambda/assignment logic more resilient so it doesn't crash when | ||
encountering long comments. | ||
links: | ||
- https://github.com/palantir/palantir-java-format/pull/203 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ir-java-format/src/test/resources/com/palantir/javaformat/java/testdata/palantir-11.input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public class Palantir11 { | ||
private void foo() { | ||
boolean answer = strategy.accept(Strategies.visitor( | ||
greaterThan -> true, // we don't need to validate greaterThan because it'll roll up to a good version | ||
exact -> !coordinates.contains(MavenCoordinate.of(productId, exact.getVersion())), | ||
remove -> true, | ||
stay -> true, | ||
stayWithExceptions -> | ||
!coordinates.contains(MavenCoordinate.of( | ||
productId, | ||
stayWithExceptions.getDeploymentsExceptionVersion().getVersion())))); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...r-java-format/src/test/resources/com/palantir/javaformat/java/testdata/palantir-11.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class Palantir11 { | ||
private void foo() { | ||
boolean answer = strategy.accept(Strategies.visitor( | ||
greaterThan -> true, // we don't need to validate greaterThan because it'll roll up to a good version | ||
exact -> !coordinates.contains(MavenCoordinate.of(productId, exact.getVersion())), | ||
remove -> true, | ||
stay -> true, | ||
stayWithExceptions -> !coordinates.contains(MavenCoordinate.of( | ||
productId, | ||
stayWithExceptions.getDeploymentsExceptionVersion().getVersion())))); | ||
} | ||
} |