commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Dougherty <r...@rd.gen.nz>
Subject Re: cvs commit: jakarta-commons/collections/src/java/org/apache/commons/collections/comparat ors ComparableComparator.java
Date Tue, 07 Jan 2003 19:01:34 GMT
>   +    /**
>   +     * Implement a hash code for this comparator that is consistent with
>   +     * {@link #equals}.
>   +     *
>   +     * @return a hash code for this comparator.
>   +     * @since Collections 2.2
>   +     */
>   +    public int hashCode() {
>   +        return "ComparableComparator".hashCode();
>   +    }

You could make that a little bit clearer by making it a constant. ie

  private static final HASH_CODE = "ComparableComparator".hashCode();

And it'll improve performance. ;-)

Rich


Mime
View raw message