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

java.math.BigInteger.ZERO.multiply(null)

XMLWordPrintable

    • b03
    • x86
    • linux
    • Not verified

        FULL PRODUCT VERSION :
        java version "1.5.0_05"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
        Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

        ADDITIONAL OS VERSION INFORMATION :
        Linux em-09.fitc.org.ar 2.6.11-6mdk #1 Tue Mar 22 16:04:32 CET 2005 i686 Intel(R) Pentium(R) 4 CPU 2.26GHz unknown GNU/Linux


        A DESCRIPTION OF THE PROBLEM :
        The specification says that "all methods in this class [java.math.BigInteger] throw NullPointerException when passed a null object reference for any input parameter", but BigInteger.ZERO.multiply(null) returns 0.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        execute the sample program

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        NullPointerException to be throw
        ACTUAL -
        return BigInteger.ZERO

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        ... the problem is there is no error message (but there should be)

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        public class ZeroByNull{
            public static void main (String[] args){
                System.out.println(java.math.BigInteger.ZERO.multiply(null));
            }
        }
        ---------- END SOURCE ----------

              darcy Joe Darcy
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: