Harmony
  1. Harmony
  2. HARMONY-455

java.util.Formatter.format() is not implemented

    Details

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

      Description

      Hello,

      java.util.Formatter.format() is not implemented. I will attach the patch soon. Thanks a lot.

        Activity

        Hide
        Paulex Yang added a comment -

        The format() is partly implemented in this patch, the integer/float/data format feature is not included because this patch is not small already. I'll attach the features left if this one is acceptted.

        There are some tests fail on RI, and I consider they are RI's bugs, as below:

        FomatterTest.test_formatLjava_lang_String$Ljava_lang_Object_Percent(), Line1062: error on RI, specification says FormatFlagsConversionMismatchException should be thrown but RI throw IllegalFormatFlagsException.

        FomatterTest.test_formatLjava_lang_String$Ljava_lang_Object_GeneralConversion(), Line1257: fail on RI. Spec says that If the '#' flag is present and the argument is not a Formattable , then a FormatFlagsConversionMismatchException should be thrown, but RI doesn't.

        FormatterTest.test_formatLjava_lang_String$Ljava_lang_Object_CharacterConversion(),Line1328 and 1333: error on RI, RI does not support converter 'C' and throws UnknownFormatConversionException.

        Please try this patch, thanks a lot.

        Show
        Paulex Yang added a comment - The format() is partly implemented in this patch, the integer/float/data format feature is not included because this patch is not small already. I'll attach the features left if this one is acceptted. There are some tests fail on RI, and I consider they are RI's bugs, as below: FomatterTest.test_formatLjava_lang_String$Ljava_lang_Object_Percent(), Line1062: error on RI, specification says FormatFlagsConversionMismatchException should be thrown but RI throw IllegalFormatFlagsException. FomatterTest.test_formatLjava_lang_String$Ljava_lang_Object_GeneralConversion(), Line1257: fail on RI. Spec says that If the '#' flag is present and the argument is not a Formattable , then a FormatFlagsConversionMismatchException should be thrown, but RI doesn't. FormatterTest.test_formatLjava_lang_String$Ljava_lang_Object_CharacterConversion(),Line1328 and 1333: error on RI, RI does not support converter 'C' and throws UnknownFormatConversionException. Please try this patch, thanks a lot.
        Hide
        Mikhail Loenko added a comment -

        applied to revision 410036

        Transformer.locale is never used (comment says it will be in new feature); kept it there

        Richard please verify that it was done as expected

        Show
        Mikhail Loenko added a comment - applied to revision 410036 Transformer.locale is never used (comment says it will be in new feature); kept it there Richard please verify that it was done as expected
        Hide
        Paulex Yang added a comment -

        looks fine, thank you, Mikhail. And for your information, the Transformer.locale will be used in the coming date format feature.

        Show
        Paulex Yang added a comment - looks fine, thank you, Mikhail. And for your information, the Transformer.locale will be used in the coming date format feature.
        Hide
        Richard Liang added a comment -

        Thanks Mikhail,

        The fix looks good.

        Show
        Richard Liang added a comment - Thanks Mikhail, The fix looks good.
        Hide
        Mikhail Loenko added a comment -

        verified by Richard

        Show
        Mikhail Loenko added a comment - verified by Richard

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development