Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-630

Revise javax.enterprise.util.AnnotationLiteral.cachedHashCode

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Optional
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Currently, AnnotationLiteral.hashCode() always returns 0 if there are no members (ignoring annotation type completely). Although it does not break Object.hashCode() contract, I believe we should either return a number based on the annotation type (to make the annotation literal instances more usable in hash tables) or simply return zero and don't cache the value at all.

      UPDATE: We may not return a number based on the annotation type because it would break the java.lang.annotation.Annotation.hashCode() contract.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  mkouba Martin Kouba
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: