Uploaded image for project: 'Spring Modules'
  1. Spring Modules
  2. MOD-200

Reflections reflectionHashCode always returns INITIAL_HASH for java.util.Date objects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5
    • Fix Version/s: 0.7
    • Component/s: CACHE
    • Labels:
      None
    • Environment:
      spring modules 0.5, spring 1.2.7

      Description

      Reflections reflectionHashCode always returns INITIAL_HASH for java.util.Date objects.

      The problem is on lines 75,76 of Reflections.java - the Date object fails the conditions here and nullSafeHashCode (which would return the result of the Date hashCode() method) is not called. The class then attempts to generate a hash from the Dates declared fields, but cannot find any non-transient / non static fields and returns the INITIAL_HASH value.

      Modifying lines 75,76 adding a '|| obj instanceof Date' condition would allow nullSafeHashCode to be called, returning the result of java.util.Date hashCode().

        Attachments

          Activity

            People

            Assignee:
            irbouho Omar Irbouh
            Reporter:
            ambeth Andrew Bethell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: