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

[lworld] Document APIs that require Identity objects as parameters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • core-libs

      There are a number of APIs that require identity objects as arguments.
      The would include any that pass an object for which a java.lang.Reference might be used to refer to the argument. For example, WeakHashmap, or the Cleaner, or WeakReference, SoftReference.

      APIs that restrict their arguments to identity objects should document the requirement in the package, or class documentation and include \@throws IdentityException where appropriate.
      The implementations should use `java.util.Objects.requireIdentity(obj, msg)` to check the arguments and throw an appropriate exception.

            rriggs Roger Riggs
            rriggs Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: