-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent NPE when javadoc contains '@Formatter:off'
Update `JavadocLineBreakPreparator` to protect against a `null` return from `commentToken.getInternalStructure()`. Fixes gh-410
- Loading branch information
Showing
4 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
...spring-javaformat-formatter-tests/src/test/resources/expected/javadoc-with-format-off.txt
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,8 @@ | ||
/** | ||
* This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. | ||
* @formatter:off | ||
* @formatter:on | ||
*/ | ||
public class Format { | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...t/spring-javaformat-formatter-tests/src/test/resources/source/javadoc-with-format-off.txt
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,7 @@ | ||
/** | ||
* This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. This is a test. | ||
* @formatter:off | ||
* @formatter:on | ||
*/ | ||
public class Format { | ||
} |
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