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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 16, 17, 18
    • 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.

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

              Created:
              Updated: