Skip to content

Commit

Permalink
Don't reformat javadoc comments with extra *
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=274236131
  • Loading branch information
cushon authored and kluever committed Oct 14, 2019
1 parent 05df9d3 commit 3717179
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ public boolean isSlashStarComment() {

@Override
public boolean isJavadocComment() {
return text.startsWith("/**") && text.length() > 4;
// comments like `/***` are also javadoc, but their formatting probably won't be improved
// by the javadoc formatter
return text.startsWith("/**") && text.charAt("/**".length()) != '*' && text.length() > 4;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void empty() {
"class Test {}",
};
String[] expected = {
"/** */", "class Test {}",
"/***/", "class Test {}",
};
doFormatTest(input, expected);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*************************************************************************************************************************************************************
* Copyright
*
* Some
*
* Company
*************************************************************************************************************************************************************/
class T {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*************************************************************************************************************************************************************
* Copyright
*
* Some
*
* Company
*************************************************************************************************************************************************************/
class T {}

0 comments on commit 3717179

Please sign in to comment.