RFR: JDK-8298405: Markdown support in the standard doclet

Pavel Rappo prappo at openjdk.org
Wed Jan 4 20:08:55 UTC 2023


On Wed, 4 Jan 2023 18:42:08 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/DocPretty.java line 214:
>> 
>>> 212:                 for (DocTree node : nodes) {
>>> 213:                     Boolean b = scan(node, ignore);
>>> 214:                     if (b != null && b.equals(Boolean.TRUE)) {
>> 
>> Could it be `b == Boolean.TRUE`?
>
> In general, no, because of the possibility of `new Boolean` so it will depend on the code in `scan`. I'll investigate.

You are correct. I keep forgetting about those now-deprecated-for-removal constructors for `java.lang.Boolean`.

What you have now is good. Alternatively, you could use `Boolean.TRUE.equals(b)`, a Yoda condition, which you might or might not find aesthetically pleasing.

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

PR: https://git.openjdk.org/jdk/pull/11701


More information about the javadoc-dev mailing list