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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      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


        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: