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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description

      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)

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: