Martin Mucha has posted comments on this change. Change subject: core: AuditLogDirector should not have static methods ......................................................................
Patch Set 13: (3 comments) 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, it's hard to tell(for me). Someone would what this in this patch (you), someone would be offended by that. So I did minimum change in hope to please all. I'm going to create follow-up patch doing rest of DI. Then we can either squash it or clean in any way. 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. one is in static method, other in instance. DI, i believe, do not work for static fields. But given the size of this patch, I did not check details. This method is 'static' for no good reason, so I'm changing it so it's instance method and can reuse nonstatic field. 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. Done 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