weizhouapache commented on code in PR #12407:
URL: https://github.com/apache/cloudstack/pull/12407#discussion_r2682120856
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -1686,7 +1686,7 @@ public boolean
deleteKubernetesCluster(DeleteKubernetesClusterCmd cmd) throws Cl
public static boolean
checkIfVmsAssociatedWithBackupOffering(List<VMInstanceVO> vms) {
for(VMInstanceVO vm : vms) {
- if (Objects.nonNull(vm.getBackupOfferingId())) {
+ if (ObjectUtils.allNotNull(vm, vm.getBackupOfferingId())) {
Review Comment:
yes, the values are checked in the order.
if the first value is null, it returns `false` without checking the second
value
I think it is same to `vm != null && vm.getBackupOfferingId() != null`
refer to the code of `allNotNull` method
```
public static boolean allNotNull(Object... values) {
if (values == null) {
return false;
} else {
for(Object val : values) {
if (val == null) {
return false;
}
}
return true;
}
}
```
--
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]