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

[lworld][c1] null check is needed when reading non-nullable static fields

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      If Point is a value class, when reading a static field of Point type, a null check is needed so we can return Point.default if this field was not explicitly initialized:

      class C {
          static Point p; // no explicit initialization
          static Point get_p() {
              return p;
          }
      }

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: