You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Rich Dougherty <ri...@rd.gen.nz> on 2003/01/07 20:01:34 UTC
Re: cvs commit:
jakarta-commons/collections/src/java/org/apache/commons/collections/comparat
ors ComparableComparator.java
> + /**
> + * 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