RFR: JDK-8307184: Incorrect/inconsistent specification and implementation for Elements.getDocComment [v5]

Jonathan Gibbons jjg at openjdk.org
Wed Aug 2 21:51:42 UTC 2023


On Fri, 28 Jul 2023 05:51:58 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> Start by just reformatting the existing specs to highlight subsequent spec changes.
>
> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Appease jcheck.

src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 286:

> 284:      * begins with "{@code /**}", ends with a separate
> 285:      * "<code>*/</code>", and immediately precedes the element,
> 286:      * ignoring white space and annotations and end-of-line-comments ({@code "//"} comments).

Turns out that simple block comments are ignored as well. Try:

/**
 * This is HW.
 */
/* block comment. */
// line comment
public class HW { }

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15062#discussion_r1282451927


More information about the compiler-dev mailing list