Change in ovirt-engine[master]: core: Remove option after checking null

juan.hernandez at redhat.com juan.hernandez at redhat.com
Thu Sep 24 11:41:48 UTC 2015


Juan Hernandez has submitted this change and it was merged.

Change subject: core: Remove option after checking null
......................................................................


core: Remove option after checking null

This is necessary to avoid the following findbugs warning:

  Nullcheck of value previously dereferenced

  A value is checked here to see whether it is null, but this value can't
  be null because it was previously dereferenced and if it were null a
  null pointer exception would have occurred at the earlier dereference.
  Essentially, this code and the previous dereference disagree as to
  whether this value is allowed to be null. Either the check is redundant
  or the previous dereference is erroneous.

  Bug kind and pattern: RCN - RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE

This looks like a real potential bug, so this patch moves the call to
the method that dereferences the value inside the "if" block that checks
if it is not null.

Change-Id: I8538c9d2f938930ca717d1539215c6b7e0472752
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved; Passed CI tests
  Martin Mucha: Looks good to me, but someone else must approve



-- 
To view, visit https://gerrit.ovirt.org/46564
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8538c9d2f938930ca717d1539215c6b7e0472752
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Martin Mucha <mmucha at redhat.com>
Gerrit-Reviewer: Shubhendu Tripathi <shtripat at redhat.com>
Gerrit-Reviewer: automation at ovirt.org



More information about the Engine-commits mailing list