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

Support for varargs in class Polygon

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx
    • 2.0 EA

      The constructor of the polygon class uses a traditional pre Java 5 array parameter which requires you to declare double arrays to set the coordinates as follows:

      Polygon polygon = new Polygon(
      new double[] {
      1.0, 2.0, 3.0
      }
      );

      I request that the signature of the Polygon constructor is changed to support var args, thereby allowing me to write

      Polygon polygon = new Polygon(1.0, 2.0, 3.0);

      If you think about it, this is a low cost / high benefit issue - it is a very small code change which will save all Java FX developers some typing.

            janvalenta Jan Valenta (Inactive)
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: