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

java.text.MessageFormat has incorrect doc comment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • core-libs
    • b06

      In the Usage Information of java.text.MessageFormat, there is a comment in the example source code with the wrong variable name.

      * MessageFormat mf = new MessageFormat("{0}, {0}, {0}");
       * String forParsing = "x, y, z";
       * Object[] objs = mf.parse(forParsing, new ParsePosition(0));
       * // result now equals {new String("z")}

      The comment should be targeted at objs, not result.

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: