Maor Lipchuk has uploaded a new change for review. Change subject: core(wip): remove null check at executeReadList ......................................................................
core(wip): remove null check at executeReadList I'm not sure if the null validation at executeReadList is historical remain or not, but I think this check is redundant, or at least should be re examined for the following reasons: 1) We already sets the key RETURN_VALUE at createCallForRead before each call, when creating the SimpleJdbcCall, so there is no reason we will get back the answer from JDBC without it in the result map. 2) Until now executeRead called executeReadList and did not checked if the returned list is null or not. benefits of removing the null condition, less validation, more efficiency. Change-Id: I54f25002701bcaa6e82a572b6fa5ed8ffa5e043a Signed-off-by: Maor Lipchuk <[email protected]> --- M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/19818/1 diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java index f06587f..85b0900 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java @@ -101,9 +101,7 @@ final RowMapper<T> mapper, final MapSqlParameterSource parameterSource) { Map<String, Object> resultsMap = executeReadAndReturnMap(procedureName, mapper, parameterSource); - List<?> resultList = (List<?>) (resultsMap - .get(BaseDAODbFacade.RETURN_VALUE_PARAMETER)); - return (resultList != null) ? (List<T>) resultList : null; + return (List<T>) (resultsMap.get(BaseDAODbFacade.RETURN_VALUE_PARAMETER)); } public <T> Map<String, Object> executeReadAndReturnMap(final String procedureName, -- To view, visit http://gerrit.ovirt.org/19818 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54f25002701bcaa6e82a572b6fa5ed8ffa5e043a Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
