Arik Hadas has uploaded a new change for review.

Change subject: core: extract check for compensation context
......................................................................

core: extract check for compensation context

The check for whether or not the command was instantiated for
compensation in CommandBase#postConstruct is extracted to a separate
method for clarity

Change-Id: I9588b2cad9eefaf6bb20fc7478946b12a025022e
Signed-off-by: Arik Hadas <aha...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/97/41297/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
index d3d8e70..453fa8a9 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
@@ -205,12 +205,15 @@
      */
     @PostConstruct
     protected final void postConstruct() {
-        // do not initialize for compensation
-        if (getParameters() != null) {
+        if (!isCompensationContext()) {
             init();
         }
     }
 
+    private boolean isCompensationContext() {
+        return getParameters() == null;
+    }
+
     /**
      * Implement this method whenever you need extra initialization of the 
command after the
      * constructor. All DB calls or other interaction with the command 
dependencies for initialization


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9588b2cad9eefaf6bb20fc7478946b12a025022e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <aha...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to