jax-rs-spec
  1. jax-rs-spec
  2. JAX_RS_SPEC-421

EntityTag.equals(): Remove unnecessary call to super.equals()

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1
    • Component/s: runtime
    • Labels:
      None

      Description

      javax.ws.rs.core.EntityTag invokes:

      if (!(obj instanceof EntityTag))
        return super.equals(obj);
      

      The second line should return false.

      1. This is the first time I've ever seen equals() delegate to super in case of a type mismatch. I find it hard to imagine when this would be useful.
      2. EntityTag extends Object, so in this case we are guaranteed super.equals(obj) will return false. We might as well return false for clarity, if nothing else.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            cowwoc
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: