Harmony
  1. Harmony
  2. HARMONY-985

[classlib][luni] bug-to-bug compatibility java.util.Formatter.Formatter(Appendable a)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      For the constructor java.util.Formatter.Formatter(Appendable a):

      If we pass a null to j.u.Formatter.Formatter(Appendable a), when we try to get the destination of the formatter's output by calling formatter.out(), RI will thrown a java.util.FormatterClosedException. But according to the specification, the destination should be a StringBuilder.

      Harmony complies with the specification, but RI breaks the specification.

      References:
      1) Specification:
      public Formatter(Appendable a)
      Constructs a new formatter with the specified destination.
      The locale used is the default locale for this instance of the Java virtual machine.
      Parameters:
      a - Destination for the formatted output. If a is null then a StringBuilder will be created.
      2) The following test passes on Harmony, but fails on RI.
      public void test_ConstructorLjava_lang_Appendable()

      { Formatter formatter = new Formatter((Appendable) null); Appendable out = formatter.out(); assertTrue(out instanceof StringBuilder); }


      3) Discussion in harmony-dev: http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg09376.html

        Activity

        Richard Liang created issue -
        Hide
        Tony Wu added a comment -
        Show
        Tony Wu added a comment - would be closed according discussion on http://www.mail-archive.com/harmony-dev@incubator.apache.org/msg10916.html
        Hide
        Paulex Yang added a comment -

        Verfied in dev-list as Non-bug difference.

        Show
        Paulex Yang added a comment - Verfied in dev-list as Non-bug difference.
        Paulex Yang made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        53d 15h 55m 1 Paulex Yang 18/Sep/06 03:34

          People

          • Assignee:
            Unassigned
            Reporter:
            Richard Liang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development