Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.errorprone.bugpatterns.BugChecker.VariableTreeMatcher;
import com.google.errorprone.fixes.SuggestedFix;
import com.google.errorprone.matchers.Description;
import com.google.errorprone.util.ErrorProneComment.ErrorProneCommentStyle;
import com.sun.source.doctree.DocTree;
import com.sun.source.doctree.EndElementTree;
import com.sun.source.doctree.ErroneousTree;
Expand Down Expand Up @@ -109,9 +110,13 @@ private Description handle(@Nullable DocTreePath path, VisitorState state) {
if (path == null) {
return NO_MATCH;
}
Comment comment = ((DCDocComment) path.getDocComment()).comment;
if (ErrorProneCommentStyle.from(comment.getStyle()) == ErrorProneCommentStyle.JAVADOC_LINE) {
// TODO(b/530215233): Add support for Markdown Javadocs
return NO_MATCH;
}
RangesFinder rangesFinder = new RangesFinder(state);
rangesFinder.scan(path, null);
Comment comment = ((DCDocComment) path.getDocComment()).comment;
Matcher matcher = GENERIC_PATTERN.matcher(comment.getText());
RangeSet<Integer> generics = TreeRangeSet.create();
while (matcher.find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,27 +353,20 @@ interface Test {}
@Test
public void markdownJavadoc() {
assume().that(Runtime.version().feature()).isAtLeast(23); // Markdown Javadoc is JDK 23+
// TODO(b/530215233): This should be unchanged.
refactoring
.addInputLines(
"Test.java",
"""
/// A command-line flag that parses arguments into a byte size represented as a `Flag<Long>`.
interface Test {}
""")
.addOutputLines(
"Test.java",
"""
/// A command-line flag that parses arguments into a byte size represented as a `{@code Flag<Long>}`.
interface Test {}
""")
.expectUnchanged()
.doTest();
}

@Test
public void markdownJavadocCodeBlock() {
assume().that(Runtime.version().feature()).isAtLeast(23); // Markdown Javadoc is JDK 23+
// TODO(b/530215233): This should be unchanged.
refactoring
.addInputLines(
"Test.java",
Expand All @@ -383,14 +376,7 @@ public void markdownJavadocCodeBlock() {
/// ```
interface Test {}
""")
.addOutputLines(
"Test.java",
"""
/// ```java
/// {@code List<String>} list;
/// ```
interface Test {}
""")
.expectUnchanged()
.doTest();
}
}
Loading