Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267394

Do not rely on object identity for empty valid Content instance

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • tools

      HtmlTree.EMPTY is a special `Text` instance that is empty yet is not discarded when added to an `HtmlTree` via `add(Content)`. This is done via object identity check. For other content objects, the decision is made by invoking `Content.isValid()`. It would be preferable to override `isValid()` to return true in HtmlTree.EMPTY rather than have a special case for HtmlTree.EMPTY.

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: