svn commit: r1818677 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java

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

svn commit: r1818677 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java

mbrohl
Author: mbrohl
Date: Tue Dec 19 15:19:10 2017
New Revision: 1818677

URL: http://svn.apache.org/viewvc?rev=1818677&view=rev
Log:
Improved: Fixing defects reported by code analysis tools, package
org.apache.ofbiz.base.util.string.
(OFBIZ-10097)

Thanks Dennis Balkir for reporting and providing the patch.

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java?rev=1818677&r1=1818676&r2=1818677&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/string/UelUtil.java Tue Dec 19 15:19:10 2017
@@ -242,14 +242,12 @@ public final class UelUtil {
 
         @Override
         public boolean equals(Object obj) {
-            if (obj instanceof ReadOnlyExpression) {
+            if (obj == this) {
                 return true;
             }
-            try {
+            if (obj instanceof ReadOnlyExpression) {
                 ReadOnlyExpression other = (ReadOnlyExpression) obj;
                 return this.object.equals(other.object);
-            } catch (ClassCastException e) {
-                Debug.logInfo(e.getMessage(), module);
             }
             return false;
         }
@@ -281,14 +279,12 @@ public final class UelUtil {
         }
         @Override
         public boolean equals(Object obj) {
-            if (obj instanceof BasicValueExpression) {
+            if (obj == this) {
                 return true;
             }
-            try {
+            if (obj instanceof BasicValueExpression) {
                 BasicValueExpression other = (BasicValueExpression) obj;
                 return this.varName.equals(other.varName);
-            } catch (ClassCastException e) {
-                Debug.logInfo(e.getMessage(), module);
             }
             return false;
         }