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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user