Moti Asayag has posted comments on this change.

Change subject: engine: A check for possible NPE in 
RemoveExternalEventCommand.canDoAction
......................................................................


Patch Set 1: (1 inline comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveExternalEventCommand.java
Line 26:         if (event == null) {
Line 27:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND);
Line 28:             result = false;
Line 29:         }
Line 30:         if ((event.getOrigin() != null) && 
(event.getOrigin().equalsIgnoreCase(OVIRT))) {
no need for the extra brackets.

instead of adding a null check, just revert the comparison order:

if (OVIRT.equalsIgnoreCase(event.getOrigin())) {
...
}
Line 31:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN);
Line 32:             result = false;
Line 33:         }
Line 34:         if (!event.getseverity().equals(AuditLogSeverity.ALERT)) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I64014addc38828506d6d04c63dabdbab555f1481
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to