mooli tayer has posted comments on this change.

Change subject: core: AuditLogDirector should not have static methods
......................................................................


Patch Set 13:

(3 comments)

I am in favor of this change.

I would especially like to see all the static getInstances go away some day...

http://gerrit.ovirt.org/#/c/29589/13/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateOvfStoresForStorageDomainCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateOvfStoresForStorageDomainCommand.java:

Line 85:             } else {
Line 86:                 getBackend().endAction(p.getCommandType(),
Line 87:                         p,
Line 88:                         
getContext().clone().withoutCompensationContext().withoutExecutionContext().withoutLock());
Line 89:                 new AuditLogDirector().log(this, 
AuditLogType.CREATE_OVF_STORE_FOR_STORAGE_DOMAIN_FAILED);
If this is done in preparation for dependency injection,
Shouldn't all use you other pattern?

private final AuditLogDirector auditLogDirector = new AuditLogDirector();
...
auditLogDirector.log()
Line 90:             }
Line 91:         }
Line 92: 
Line 93:         if (atleastOneSucceeded) {


http://gerrit.ovirt.org/#/c/29589/13/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java:

new is done twice here.
Line 1: package org.ovirt.engine.core.bll;
Line 2: 
Line 3: import java.util.ArrayList;
Line 4: import java.util.Arrays;


http://gerrit.ovirt.org/#/c/29589/13/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java:

Line 36:             throw new RuntimeException("Could not find ResourceBundle 
file '" + getResourceBundleName() +"'.");
Line 37:         }
Line 38:     }
Line 39: 
Line 40:     static String getResourceBundleName() {
package private.
Line 41:         return "bundles/AuditLogMessages";
Line 42:     }
Line 43: 
Line 44:     public static String getMessage(AuditLogType logType) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id88ecd68fdc469bd0ddfdf4ae9c7f6d22ff8e8bf
Gerrit-PatchSet: 13
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: mooli tayer <mta...@redhat.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