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

com.sun.org.apache.bcel.internal.Constants.ArrayType missing hashCode()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 6u14
    • xml
    • 1.4
    • x86
    • windows_xp
    • Verified

        FULL PRODUCT VERSION :
        jdk1.6.0_14

        A DESCRIPTION OF THE PROBLEM :
        com.sun.org.apache.bcel.internal.Constants.ArrayType implments equals() and hashcode() but NOT hashCode().

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        look at the code.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        hashcode() should be hashCode()

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
          /** @return a hash code value for the object.
           */
          public int hashcode() { return basic_type.hashCode() ^ dimensions; }

          /** @return true if both type objects refer to the same array type.
           */
          public boolean equals(Object type) {
            if(type instanceof ArrayType) {
              ArrayType array = (ArrayType)type;
              return (array.dimensions == dimensions) && array.basic_type.equals(basic_type);
            } else
              return false;
          }
        ---------- END SOURCE ----------

              joehw Joe Wang
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: