Martin Peřina has posted comments on this change.

Change subject: event map: render optional.
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.ovirt.org/#/c/31776/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddEventSubscriptionCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddEventSubscriptionCommand.java:

Line 35:         } else if(!eventExists(eventName)){
Line 36:             
addCanDoActionMessage(VdcBllMessages.EN_UNSUPPORTED_NOTIFICATION_EVENT);
Line 37:             retValue = false;
Line 38:         }
Line 39:           else {
Could you please reformat "else" statement using Java Code Conventions?

     retValue = false;
 } else {
     // get notification method
Line 40:             // get notification method
Line 41:             if (eventNotificationMethod != null) {
Line 42:                 // Validate user
Line 43:                 DbUser user = 
DbFacade.getInstance().getDbUserDao().get(subscriberId);


Line 55:         return retValue;
Line 56:     }
Line 57: 
Line 58:     private boolean eventExists(String eventName) {
Line 59:         for (AuditLogType alt : AuditLogType.values()) {
Wouldn't this solution be better rather than traverse through all values and do 
string comparisons?

 private boolean eventExists(String eventName) {
     boolean exists = false;
     try {
         AuditLogType.valueOf(eventName);
         exists = true;
     } catch (Exception ex) {
     }
     return exists;
 }
Line 60:             if (alt.name().equals(eventName)) {
Line 61:                 return true;
Line 62:             }
Line 63:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I93d39249c9b57802948f356b5f0ad470ab7f32b1
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Anonymous Coward #1000397
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Jiří Moskovčák <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to