On Thu, 20 May 2021 14:31:33 GMT, Hannes Wallnöfer <hann...@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)`. Agreed to leave this for now. I think we can incrementally go after sites that are creating invalid nodes. I don't see why it is so bad to use a sentinel value to mark "temporarily empty" nodes, but I do think it's an error than the name of the sentinel suggests it can be used for other purposes -- i.e. as a general purpose "empty" node. ------------- PR: https://git.openjdk.java.net/jdk/pull/4130