From d232eae643329b21ec6e4d0909a4cd88929789cc Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Wed, 9 Aug 2017 15:44:00 +0000 Subject: [PATCH] Improved: [FB] Package org.apache.ofbiz.base.lang (OFBIZ-9564) Implemented method hashCode() because method equals() was implemented Changed Exception to RuntimeException because no exception was thrown and the only occurring exception could be a runtimeexception Thanks: Dennis Balkir git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804556 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/ofbiz/base/lang/ComparableRange.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java b/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java index bdb429ce40..f58d1bb16e 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java @@ -73,8 +73,13 @@ public class ComparableRange> implements Range, Compa try { ComparableRange that = (ComparableRange) obj; return this.start.equals(that.start()) && this.end.equals(that.end()); - } catch (Exception e) {} - return false; + } catch (RuntimeException e) { + return false; + } + } + + public int hashCode() { + return super.hashCode(); } public int compareTo(ComparableRange range) {