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

BigDecimal toString() return different value when use idea run and debug

XMLWordPrintable

    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
      I find a strange problem in oracle jdk(jdk8,jdk9)
       
        the problem is :
        java BigDecimal class toString() return different value when use idea run and idea debug

        code:
              BigDecimal bigDecimal = new BigDecimal("1");
              System.out.println(bigDecimal.toString());

      it is very simple , the value is 1 when we run the code.
      but when we add a breaking point in the BigDecimal class source code(the line is 428, if (offset + len > in.length || offset < 0)) ,then we debug the code ,the return value is 0.
      i don't known the reason .

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      CODE:
      BigDecimal bigDecimal = new BigDecimal("1");
      System.out.println(bigDecimal.toString());

      desc
      when we add a breaking point in the BigDecimal class source code(the line is 428, if (offset + len > in.length || offset < 0)) ,then we debug the code ,the return value is 0.


      FREQUENCY : always


            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: