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

Export the NPE backtracking functionality to general null-checking APIs

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 26
    • hotspot
    • None

      JEP 358 has an NPE backtracking functionality that prints the action that causes the NPE and the source of the `null`. The part where it prints the source of the `null` is useful to general null-checking APIs.

      Initially, we anticipated to export this only for Objects::requireNonNull as seen in JDK-8233268. However, it turns out that we may have other APIs that want this too, such as `java.lang.runtime.Checks::nullCheck` as proposed by JDK-8357936. So we should export this into a generic API in `JavaLangAccess` usable by any interested null-checking APIs in the JDK, which also makes it easy to test in our own test suites.

      In addition, separating this effort from the actual migration of rNN and nullCheck avoids redundant CSR review cycles and makes the whole work cleaner.

            liach Chen Liang
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: