Martin Mucha has posted comments on this change.

Change subject: engine: Add ModifiedNetworkAttachmentValidator
......................................................................


Patch Set 15:

(1 comment)

https://gerrit.ovirt.org/#/c/34967/15/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ModifiedNetworkAttachmentValidator.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/ModifiedNetworkAttachmentValidator.java:

Line 67: 
Line 68:         return oldAttachment;
Line 69:     }
Line 70: 
Line 71:     private Network getOldNetwork() {
> internalized = initialized (oops...)
Ok, so I start to examine this class more thoroughly with radicality enabled :) 
 

At first, it's not used, that's to be fixed. 2. extending from 
NetworkAttachmentValidator makes no sense and only complicates situation. 3. 
when network cannot change, rendering getOldNetwork is poitness and so is 
NotRemovingManagementNetwork 4. after that we're left with two methods: 
"networkAttachmentExists" verifying whether attachment of given id exists and 
which belongs to NetworkAttachmentValidator (moved there), and method 
"networkNotUsedByVms". This methods usage of 
'NetworkAttachmentValidator.getNetwork()' probably established class hierarchy. 
(Moved method to NetworkAttachmentValidator as well). This rendered class 
entirelly pointless, removed, commit squashed into: engine: Add 
NetworkAttachmentValidator
Line 72:         if (oldNetwork == null) {
Line 73:             oldNetwork = 
getDbFacade().getNetworkDao().get(getOldNetworkAttachment().getNetworkId());
Line 74:         }
Line 75: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie64dff04dbf43b8507b0559d82dc56a24e170e7d
Gerrit-PatchSet: 15
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to