Fix missing null checks in the ClassFile API

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 24
    • Affects Version/s: None
    • Component/s: core-libs

      ClassFile
      API Preview PR comment from [~mcimadamore]:

      It is not clear to me as to whether all the methods in the API deal with null correctly. What we did for FFM, assuming that the classfile API is also null-hostile by default, was to add a single test which would try to call all API methods and looking for NPEs:

      jdk/test/jdk/java/foreign/TestNulls.java
      Line 80 in 2637e8d
       public class TestNulls {
      This test has saved us many times when adding/changing API methods.


      One example is `Utf8Entry.equalsString`, not null-hostile if it's already string-expanded.

            Assignee:
            Chen Liang
            Reporter:
            Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: