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

3D API methods should handle null values consistently

    XMLWordPrintable

Details

    Description

      While fixing RT-26547 I went through the new 3D code in scenegraph and noticed some bugs regarding the null handling.

      * Shape3D.java - throws NPE when CullFace is null
      fix:
      if (impl_isDirty(DirtyBits.NODE_CULLFACE)) {

      - pgShape3D.setCullFace(getCullFace());

      + pgShape3D.setCullFace(getCullFace() == null ? CullFace.BACK : getCullFace());
      }

      * PointLight, AmbientLight - don't handle null Color correctly. The null value is actually handled in the scenegraph code, but it is passed to render tree and then NPE is thrown while rendering.

      In the rest of the scenegraph we take following approach:
      * in setters of properties we just use default value if the value given by user is null (because of the binding)
      * in other methods (setters for values which are not properties, etc.). we throw NPE

      Attachments

        Activity

          People

            ckyang Chien Yang (Inactive)
            ekrejcir Eva Krejčířová (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: