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

java.lang.Bignum.equals() method works wrong with non-Bignum objects

XMLWordPrintable

    • 1.1
    • sparc
    • solaris_2.5
    • Not verified

      Should return false but throws ClassCastException.
      ==== Here is the minimized test demonstrating the bug ====
      import java.lang.Bignum;
      class java_lang_Bignum_equals {
        public static void main(String args[]) {
          Bignum b=new Bignum(1);
          System.out.println(b.equals("String")); // should print "false"
        }
      }
      ==== Here is the output of the test ====
      java.lang.ClassCastException: java.lang.String
      at java.lang.Bignum.equals(Bignum.java)
      at java_lang_Bignum_equals.main(java_lang_Bignum_equals.java:5)

            mhapnersunw Mark Hapner (Inactive)
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: