From 3f84c0412cf2dad129e60e6c6c4047983ddecb97 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Wed, 5 Jul 2006 06:33:33 +0000 Subject: [PATCH] Added hashCode method for inner Token class as recommended by PMD git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@419176 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/commons/lang/time/DurationFormatUtils.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/org/apache/commons/lang/time/DurationFormatUtils.java b/src/java/org/apache/commons/lang/time/DurationFormatUtils.java index 1a83a7f69..05fb460c1 100644 --- a/src/java/org/apache/commons/lang/time/DurationFormatUtils.java +++ b/src/java/org/apache/commons/lang/time/DurationFormatUtils.java @@ -618,6 +618,15 @@ public boolean equals(Object obj2) { } } + /** + * Returns a hashcode for the token equal to the + * hashcode for the token's value. Thus 'TT' and 'TTTT' + * will have the same hashcode. + */ + public int hashCode() { + return this.value.hashCode(); + } + /** * Represents this token as a String. *