From 9e41a4a174517103fee6f98beee67064a44be00e Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Tue, 3 Apr 2018 10:51:29 +0000 Subject: [PATCH] Improved: EntityUtilProperties (OFBIZ-7112) Remove useless redundant code. results map is already initialised in the beginning with isExistInDb as "N" and value as "". These values only changed when systemProperty != null. S o except for this condition if we return results at any point it will have isExistInDb as "N" and value as "". If we remove the lines I removed in the patch, it will only remove put operations that are not necessary. Thanks: Aditya git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1828217 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/ofbiz/entity/util/EntityUtilProperties.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java index 93a8b29f55..25b67a51c1 100644 --- a/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java +++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java @@ -57,8 +57,6 @@ public final class EntityUtilProperties implements Serializable { results.put("value", ""); if (UtilValidate.isEmpty(resource) || UtilValidate.isEmpty(name)) { - results.put("isExistInDb", "N"); - results.put("value", ""); return results; } resource = resource.replace(".properties", ""); @@ -72,12 +70,6 @@ public final class EntityUtilProperties implements Serializable { //property exists in database results.put("isExistInDb", "Y"); results.put("value", (systemProperty.getString("systemPropertyValue") != null) ? systemProperty.getString("systemPropertyValue") : ""); - return results; - } else { - //property does not exists in database - results.put("isExistInDb", "N"); - results.put("value", ""); - return results; } } catch (GenericEntityException e) { Debug.logError("Could not get a system property for " + name + " : " + e.getMessage(), module);