svn commit: r1804556 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1804556 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java

jleroux@apache.org
Author: jleroux
Date: Wed Aug  9 15:44:00 2017
New Revision: 1804556

URL: http://svn.apache.org/viewvc?rev=1804556&view=rev
Log:
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

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java?rev=1804556&r1=1804555&r2=1804556&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/lang/ComparableRange.java Wed Aug  9 15:44:00 2017
@@ -73,8 +73,13 @@ public class ComparableRange<T extends C
         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<T> range) {