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

BigInteger.ZERO.equals(0)

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Window 10

      A DESCRIPTION OF THE PROBLEM :
      this method should return true but returns false

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      execute method BigInteger.ZERO.equals(0)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      BigInteger.ZERO.equals(0) returns true
      ACTUAL -
      BigInteger.ZERO.equals(0) returns false


      CUSTOMER SUBMITTED WORKAROUND :
      create a new BigInteger before passing it to the equals method, which should be done inside of the BigInteger equals method for anything that is a Number
      isTrue(BigInteger.ZERO.equals(BigInteger.valueOf(0)));

      FREQUENCY : always


            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: