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

Index selection of overloaded java new constructors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u40
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        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)

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: