RodrigoDLopez commented on a change in pull request #5386:
URL: https://github.com/apache/cloudstack/pull/5386#discussion_r728316650



##########
File path: 
api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportUnmanagedInstanceCmd.java
##########
@@ -221,17 +221,17 @@ public Long getServiceOfferingId() {
         if (MapUtils.isNotEmpty(nicIpAddressList)) {
             for (Map<String, String> entry : (Collection<Map<String, 
String>>)nicIpAddressList.values()) {
                 String nic = entry.get(VmDetailConstants.NIC);
-                String ipAddress = 
Strings.emptyToNull(entry.get(VmDetailConstants.IP4_ADDRESS));
+                String ipAddress = 
StringUtils.defaultIfEmpty(entry.get(VmDetailConstants.IP4_ADDRESS), null);

Review comment:
       particularly, I prefer an inline IF over using a stringUtils method for 
the same purpose.

##########
File path: 
plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
##########
@@ -1426,7 +1426,7 @@ public VM createVmFromTemplate(final Connection conn, 
final VirtualMachineTO vmS
             throw new CloudRuntimeException("Unable to finalize VM MetaData: " 
+ vmSpec);
         }
         try {
-            String bootMode = 
org.apache.commons.lang3.StringUtils.defaultIfEmpty(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()),
 null);
+            String bootMode = 
StringUtils.defaultIfEmpty(vmSpec.getDetails().get(ApiConstants.BootType.UEFI.toString()),
 null);

Review comment:
       if you consider replacing the use of the "defaultIfEmpty" method in the 
above comment. perform these changes here too.




-- 
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: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to