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

Jonathan Gibbons jjg at openjdk.org
Wed Aug 9 16:39:58 UTC 2023

On Fri, 4 Aug 2023 20:29:22 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 300:
>>> 298:      * if the lines start with <em>zero</em> or more white space characters followed by
>>> 299:      * <em>one</em> or more "{@code *}" characters,
>>> 300:      * those leading white space characters are discarded as are any
>> FWIW, I checked `javac` and it allows form-feed in the leading whitespace characters
>> As an adjective "white space" is normally a single word, at least in JDK.
> Hmm. java.lang.Character contains both "whitespace" and "white space" in its textual comments.

Yes, the difference is typically `whitespace` (adjective) and `white space` noun.  But no matter.

>> test/langtools/tools/javac/processing/model/util/elements/TestGetDocComments.java line 80:
>>> 78:             System.out.println("Strings have different lengths");
>>> 79:         }
>>> 80:     }
>> Not critical, but for bonus points, you could identify the first line that is different.
> Do you know of an existing utility usable in the JDK that does this?
> (I didn't want to write a utility like that for the purpose of this bug.)



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

More information about the compiler-dev mailing list