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

undefined behavior setting properties to null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8
    • javafx
    • None

      When I fixed RT-23492 I decided that when a property is set to null, (1) the getter returns null, (2) the visual appearance is default.
      For example, setting text alignment to null results in left aligned text, get text alignment returns null.

      I noticed that Shape this behavior is undefined.

      Setting StrokeLineCap to null results in ROUND caps (while the default is SQUARE).
      This random and only happen because the way toPGLineCap was coded:
      com.sun.javafx.sg.PGShape.StrokeLineCap toPGLineCap(StrokeLineCap t) {
          if (t == StrokeLineCap.SQUARE) {
              return PGShape.StrokeLineCap.SQUARE;
          } else if (t == StrokeLineCap.BUTT) {
              return PGShape.StrokeLineCap.BUTT;
          } else {
              return PGShape.StrokeLineCap.ROUND;
          }
      }


      I open to bug so we can discuss how we want to handle null values or just leave it undefined (as long as doesn't result in a exception).




            Unassigned Unassigned
            fheidric Felipe Heidrich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: