Skip to content

Commit c8511ce

Browse files
cpovirkError Prone Team
authored andcommitted
Test that SuggestedFixes.replaceIncludingComments removes Markdown Javadoc.
kak@ points out that this may have been addressed way back in 2dde254. PiperOrigin-RevId: 943937282
1 parent 63937ff commit c8511ce

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

core/src/test/java/com/google/errorprone/bugpatterns/UnusedMethodTest.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,44 @@ public class UnusedWithComment {}
253253
.doTest();
254254
}
255255

256+
@Test
257+
public void removal_markdownJavadocs() {
258+
refactoringHelper
259+
.addInputLines(
260+
"UnusedWithComment.java",
261+
"""
262+
package unusedvars;
263+
264+
public class UnusedWithComment {
265+
/// Method comment
266+
private void test1() {}
267+
268+
/// First line of method comment
269+
/// Second line of method comment
270+
private void test2() {}
271+
272+
// Keep this comment
273+
274+
/// First line of method comment
275+
///
276+
/// Second line of method comment
277+
private void test3() {}
278+
}
279+
""")
280+
.addOutputLines(
281+
"UnusedWithComment.java",
282+
"""
283+
package unusedvars;
284+
285+
public class UnusedWithComment {
286+
287+
// Keep this comment
288+
289+
}
290+
""")
291+
.doTest();
292+
}
293+
256294
@Test
257295
public void usedInLambda() {
258296
helper

0 commit comments

Comments
 (0)