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

Support for varargs in class Polygon

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Environment:

      2.0 EA

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: