sureshanaparti commented on a change in pull request #5471:
URL: https://github.com/apache/cloudstack/pull/5471#discussion_r712749631
##########
File path:
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
##########
@@ -839,10 +849,79 @@ private static void createPortGroup(String
physicalNetwork, String networkName,
}
}
- public static boolean isSpecMatch(DVPortgroupConfigInfo
currentDvPortgroupInfo, DVPortgroupConfigSpec newDvPortGroupSpec) {
+ private static boolean eitherObjectNull(Object obj1, Object obj2) {
+ return (obj1 == null && obj2 != null) || (obj1 != null && obj2 ==
null);
+ }
+
+ private static boolean areBoolPoliciesDifferent(BoolPolicy currentPolicy,
BoolPolicy newPolicy) {
+ return eitherObjectNull(currentPolicy, newPolicy) ||
+ (newPolicy != null && newPolicy.isValue() !=
currentPolicy.isValue());
Review comment:
extra not null checks may not be required (both objs are not null
ensured before using _eitherObjectNull()_), please check wherever applicable.
If both objs are null, have to add check for the other obj as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]