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

Fix missing null checks in the ClassFile API

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • 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.

            liach Chen Liang
            asotona Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: