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

Early conversion from double to int causes method selection ambiguity

    XMLWordPrintable

    Details

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

      Description

      jjs> new java.awt.Color(0.5,0.5,0.5)
      java.awt.Color[r=128,g=128,b=128]
      jjs> new java.awt.Color(1.0,0.5,0.5)
      java.lang.RuntimeException: java.lang.NoSuchMethodException: Can't
      unambiguously select between fixed arity signatures [(float, float,
      float), (int, int, int)] of the method java.awt.Color.<init> for
      argument types [java.lang.Integer, java.lang.Double, java.lang.Double]

        Attachments

          Activity

            People

            Assignee:
            attila Attila Szegedi
            Reporter:
            attila Attila Szegedi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: