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.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818677 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Brohl
2017-12-19 15:19:10 +00:00
parent 60b6d5a02f
commit 98ee1e4f01
@@ -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;
}