Allon Mureinik has uploaded a new change for review. Change subject: core: EJBUtilsStratehy - fix NPE in error log ......................................................................
core: EJBUtilsStratehy - fix NPE in error log In the findBean method, jndiNameSB is initialized inside the try block, but referenced in the catch block. If an exception was thrown before it was initialized, calling its toString() will cause a NullPointerException. This patch replaces the call of append(jndiNameSB.toString()) with append(jndiNameSB), which is null-safe. Change-Id: I6e29a2f69e68a2cc12768409fcba0162926638d7 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/29/12329/1 diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java index 09aa2bb..cb766d5 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ejb/EJBUtilsStrategy.java @@ -112,7 +112,7 @@ } catch (Exception e) { StringBuilder errorMsgSb = new StringBuilder(); errorMsgSb.append("Failed to lookup resource type: ").append(beanType).append(". JNDI name: ") - .append(jndiNameSB.toString()); + .append(jndiNameSB); log.error(errorMsgSb.toString(), e); return null; } -- To view, visit http://gerrit.ovirt.org/12329 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e29a2f69e68a2cc12768409fcba0162926638d7 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
