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

Early conversion from double to int causes method selection ambiguity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 8
    • core-libs
    • None
    • b115
    • generic
    • generic

      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]

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

              Created:
              Updated:
              Resolved: