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

java.text.DecimalFormat.parse() fails when multiplier is not set to 1

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.6
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Verified

      Backports

        Description



        Name: dfC67450 Date: 11/13/97



        java.text.DecimalFormat.parse(String text, ParsePosition pp) incorrectly parses
        Long.MIN_VALUE if multiplier is not set to 1.
         
        Here is the test demonstrating the bug:

        -----------------TestP.java------------------------
        import java.text.*;

        public class TestP {
            public static void main (String args[]){
                DecimalFormat df = new DecimalFormat();
                String str = Long.toString(Long.MIN_VALUE);
                System.out.println(df.parse(str, new ParsePosition(0)));
                df.setMultiplier(100);
                System.out.println(df.parse(str, new ParsePosition(0)));
            }
        }
        ---------Output from the test---------------------
        -9223372036854775808
        9.223372036854776E16
        --------------------------------------------------

        ======================================================================

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                joconnersunw John Oconner (Inactive)
                Reporter:
                dfazunensunw Dmitri Fazunenko (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: