Skip to content

Commit

Permalink
Don't add spaces to //$NON-NLS-x$ comments
Browse files Browse the repository at this point in the history
Fixes #221

MOE_MIGRATED_REVID=197211890
  • Loading branch information
cushon committed May 18, 2018
1 parent 9cf8dc1 commit 588b108
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ private String indentLineComments(List<String> lines, int column0) {
return builder.toString();
}

// Preserve special `//noinspection` and `//$NON-NLS-x$` comments used by IDEs, which cannot
// contain leading spaces.
private static final Pattern LINE_COMMENT_MISSING_SPACE_PREFIX =
Pattern.compile("^(//+)(?!noinspection)[^\\s/]");
Pattern.compile("^(//+)(?!noinspection|\\$NON-NLS-\\d+\\$)[^\\s/]");

private List<String> wrapLineComments(
List<String> lines, int column0, JavaFormatterOptions options) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class I221 {
{
logger.log(
Level.WARNING,
"Unable to obtain jst.web facet version from selected project", //$NON-NLS-1$
ex);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class I221 {
{
logger.log(
Level.WARNING,
"Unable to obtain jst.web facet version from selected project", //$NON-NLS-1$
ex);
}
}

0 comments on commit 588b108

Please sign in to comment.