From f8b63754655daf378cf4a6cce9a76af9dd31d129 Mon Sep 17 00:00:00 2001 From: Kui LIU Date: Mon, 23 Apr 2018 16:54:38 +0200 Subject: [PATCH] CLOUDSTACK-10359: Change the inconsistent method names. (#2591) * CLOUDSTACK-10359: Change the inconsistent method names. The two methods are named "getXXX". The two method are checking the status of variables. "getCustomized" is not as intuitive as "isCustomized". "getIsSystem" is not as intuitive as "isSystem" as well. * Add the missing changes of all usages of method getIsSystem. --- .../api/command/admin/offering/CreateServiceOfferingCmd.java | 4 ++-- .../com/cloud/configuration/ConfigurationManagerImpl.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index 0bde79bbd7b..41e5fc9021d 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -194,7 +194,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { return hostTag; } - public Boolean getIsSystem() { + public Boolean isSystem() { return isSystem == null ? false : isSystem; } @@ -210,7 +210,7 @@ public class CreateServiceOfferingCmd extends BaseCmd { return deploymentPlanner; } - public boolean getCustomized() { + public boolean isCustomized() { return (cpuNumber == null || memory == null || cpuSpeed == null); } diff --git a/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java index 80642f51375..7f41d43e069 100755 --- a/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2279,7 +2279,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati Boolean isCustomizedIops; - if (cmd.getIsSystem()) { + if (cmd.isSystem()) { if (vmTypeString == null || VirtualMachine.Type.DomainRouter.toString().toLowerCase().equals(vmTypeString)) { vmType = VirtualMachine.Type.DomainRouter; allowNetworkRate = true; @@ -2328,7 +2328,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } } - return createServiceOffering(userId, cmd.getIsSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber, memory, cpuSpeed, cmd.getDisplayText(), + return createServiceOffering(userId, cmd.isSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber, memory, cpuSpeed, cmd.getDisplayText(), cmd.getProvisioningType(), localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate(), cmd.getDeploymentPlanner(), cmd.getDetails(), isCustomizedIops, cmd.getMinIops(), cmd.getMaxIops(), cmd.getBytesReadRate(), cmd.getBytesWriteRate(), cmd.getIopsReadRate(), cmd.getIopsWriteRate(), cmd.getHypervisorSnapshotReserve());