Allon Mureinik has posted comments on this change.

Change subject: core: remove redundant use of Integer object.
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

I spotted a potential NPE - see explanation inline.
Giving -1 so it won't get merged by mistak, until it's fixed or until I get an 
explanation that reassures me I'm mistaken

....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/SimpleJdbcCallsHandler.java
Line 80:             List<?> resultArray = (List<?>) 
result.values().iterator().next();
Line 81:             if (resultArray != null && !resultArray.isEmpty()) {
Line 82:                 Map<?, ?> resultMap = (Map<?, ?>) resultArray.get(0);
Line 83:                 if (!resultMap.isEmpty()) {
Line 84:                     return 
(Integer)resultMap.values().iterator().next();
If the maps contains a single value which is null you'll have an NPE here 
instead of returning 0.

What am I missing?
Line 85:                 }
Line 86:             }
Line 87:         }
Line 88:         return 0;


-- 
To view, visit http://gerrit.ovirt.org/19819
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6b39a95caeddd6d200531e27daf5001cf8251923
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: liron aravot <liron.ara...@gmail.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to