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

ParameterizedType does not define hashCode implementation

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      The API states:
      Instances of classes that implement this interface must implement an equals() method that equates any two instances that share the same generic type declaration and have equal type parameters.

      Indicating that custom implementation of this interface is allowed, but the documentation does not state how the hashCode() is calculated. Without this information users cannot reliably place their implementations of ParameterizedType with other implementations of ParameterizedType in a data structure like a HashMap.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      An implementation of the hashCode:
      The implementors of this interface must define hashCode to be the xor of the hashCode of the owner type (if not null), the raw type, and the result of Arrays.hashCode(actualParameterTypes) where actualParameterTypes is the array returned by actualParameterTypes() method.
      ACTUAL -
      The implementation of hashCode is missing

      URL OF FAULTY DOCUMENTATION :
      http://download.oracle.com/javase/7/docs/api/java/lang/reflect/ParameterizedType.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                darcy Joe Darcy
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Imported:
                  Indexed: