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

(fmt) Ambiguity in Formatter constructors if System.out is the destination

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 5.0
    • 5.0
    • core-libs
    • b59
    • generic
    • solaris_8

      The specified set of Formatter constructors results in the following unfortunate ambiguity:

      T.java:4: reference to Formatter is ambiguous, both method Formatter(java.lang.Appendable) in java.util.Formatter and method Formatter(java.io.OutputStream) in java.util.Formatter match
              Formatter f = new Formatter(System.out);
                            ^

            iris Iris Clark
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: