RFR: JDK-8267394: Do not rely on object identity for empty valid Content instance
Jonathan Gibbons
jjg at openjdk.java.net
Fri May 28 15:45:02 UTC 2021
On Thu, 20 May 2021 14:31:33 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
> This is a simple cleanup to replace the sentinel `HtmlTree.EMPTY` text constant with an instance that achieves the same by overriding `isValid()`. I think this is the nicer solution, and it allows us to remove the special case identity check in `HtmlTree.add(Content)`.
This is questionable and probably wrong.
The use of the identity check was specifically to differentiate between a sentinel value (EMPTY) and values which just happen to be empty.
This will require detailed examination.
-------------
Changes requested by jjg (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/4130
More information about the javadoc-dev
mailing list