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

Index selection of overloaded java new constructors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40
    • core-libs
    • None
    • b22
    • generic
    • generic

        Currently there is no way to reliably predict which overloaded constructor will be used.

        var x = 1;
        print(new java.awt.Color(x, x, x)) // creates Color[r=1,g=1,b=1]

        var y = 1;
        y = y + 0;
        print(new java.awt.Color(y, y, y)) // creates Color[r=1,g=1,b=1]

        var z = 1;
        z = z * 1;
        print(new java.awt.Color(z, z, z)) // creates Color[r=255,g=255,b=255]

        Need to be able to new (java.awt["Color(int,int,int)"])(3,3, 4)

              sundar Sundararajan Athijegannathan
              jlaskey Jim Laskey
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: