You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] DanglingJavadoc: False positive on /// comments for Java < 23 #6450
changed the title [-][Java]: DanglingJavadoc: reports on //// comments[/-][+][java] DanglingJavadoc: False positive on //// comments[/+]on Feb 16, 2026
I'v just tested it with Java 25, and even with your four slashes, it ends up as javadoc:
This code
//// Test ClasspublicclassTest {}
Produces this Javadoc:
Interestingly, the slash ends up in the documentation (which could be considered a bug in the JDK)...
Regarding to PMD: If you call PMD and select a java version < 23, then ideally, the rule shouldn't report a violation. But for java versions >= 23, it should, as this is a valid documentation comment.
Did you select a specific java version via --use-version?
Since the first slash of the four slashes actually end up in the documentation, this is probably not what you want. We could create a new rule "InvalidDocumentationComment" for such cases.
Just use the normal two slashes for a comment followed by a space, like // // A comment to be on the safe side.
changed the title [-][java] DanglingJavadoc: False positive on //// comments[/-][+][java] DanglingJavadoc: False positive on //// comments for Java < 23[/+]on Feb 16, 2026
@adangel the handling of /// as comment in Java <23 is something we considered and decided to keep simple: #5916 (review)
If we were to fix it, should it be for this rule specifically or should we change the handling of /// in general?
Interestingly, the slash ends up in the documentation (which could be considered a bug in the JDK)
I think that's fine, three slashes indicate JavaDoc, fourth slash is part of the comment. Maybe IDEs could highlight it differently to make it more obvious.
Well, I would argue that a /// comment in a pre-23 Java version is a problem that should be flagged nonetheless because code featuring this would likely break the Javadoc in Java 23+ and hence, it is a problem for a modernization/migration effort. In fact, I would be concerned with the opposite problem: Having /// javadocs in pre-23 Java.
changed the title [-][java] DanglingJavadoc: False positive on //// comments for Java < 23[/-][+][java] DanglingJavadoc: False positive on /// comments for Java < 23[/+]on Aug 14, 2026
Well, I would argue that a /// comment in a pre-23 Java version is a problem that should be flagged nonetheless because code featuring this would likely break the Javadoc in Java 23+ and hence, it is a problem for a modernization/migration effort. In fact, I would be concerned with the opposite problem: Having /// javadocs in pre-23 Java.
That's not what this rule is about. But sounds like a good idea for another rule.
Activity
[-][Java]: DanglingJavadoc: reports on //// comments[/-][+][java] DanglingJavadoc: False positive on //// comments[/+]adangel commentedon Feb 16, 2026
Thanks for reporting.
Note, since Java 23, three slashes start a markdown javadoc comment - see JEP 467: Markdown Documentation Comments.
I'v just tested it with Java 25, and even with your four slashes, it ends up as javadoc:
This code
Produces this Javadoc:
Interestingly, the slash ends up in the documentation (which could be considered a bug in the JDK)...
Regarding to PMD: If you call PMD and select a java version < 23, then ideally, the rule shouldn't report a violation. But for java versions >= 23, it should, as this is a valid documentation comment.
Did you select a specific java version via --use-version?
Since the first slash of the four slashes actually end up in the documentation, this is probably not what you want. We could create a new rule "InvalidDocumentationComment" for such cases.
Just use the normal two slashes for a comment followed by a space, like
// // A commentto be on the safe side.[-][java] DanglingJavadoc: False positive on //// comments[/-][+][java] DanglingJavadoc: False positive on //// comments for Java < 23[/+]zbynek commentedon Mar 28, 2026
@adangel the handling of
///as comment in Java <23 is something we considered and decided to keep simple:#5916 (review)
If we were to fix it, should it be for this rule specifically or should we change the handling of
///in general?I think that's fine, three slashes indicate JavaDoc, fourth slash is part of the comment. Maybe IDEs could highlight it differently to make it more obvious.
[java] Fix pmd#6450: DanglingJavadoc ignores markdown javadoc (///) b…
victorwss commentedon Aug 9, 2026
Well, I would argue that a
///comment in a pre-23 Java version is a problem that should be flagged nonetheless because code featuring this would likely break the Javadoc in Java 23+ and hence, it is a problem for a modernization/migration effort. In fact, I would be concerned with the opposite problem: Having///javadocs in pre-23 Java.[-][java] DanglingJavadoc: False positive on //// comments for Java < 23[/-][+][java] DanglingJavadoc: False positive on /// comments for Java < 23[/+][java] Fix pmd#6450: Treat /// comments as markdown javadoc only sinc…
UncleOwen commentedon Sep 10, 2026
That's not what this rule is about. But sounds like a good idea for another rule.
[java] Fix pmd#6450: DanglingJavadoc should ignore markdown javadoc (…