Document behavior regarding `null` for methods related to `DocTree`

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 16, 17, 18
    • Component/s: tools

      Some methods defined in the `com.sun.source.doctree` and `com.sun.source.util` packages accept or return `null`. For example, subtypes of `DocTree` that have components of type `ReferenceTree` may return `null` when accessing such components. Similarly, `DocTreeFactory` may accept `null` when creating trees that have `ReferenceTree` components.

      To relieve users of any guess-work or experimenting, this should be explicitly specified.

      While at it, it's also a good idea to specify if particular methods in those packages are allowed to return or accept `null` instead of an empty `List<...>`. If there are no such methods, perhaps this "empty lists, not nulls" policy should be specified on a type or even package level.

            Assignee:
            Unassigned
            Reporter:
            Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: