You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2018/04/23 14:54:41 UTC

[cloudstack] branch master updated: CLOUDSTACK-10359: Change the inconsistent method names. (#2591)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/master by this push:
     new f8b6375  CLOUDSTACK-10359: Change the inconsistent method names. (#2591)
f8b6375 is described below

commit f8b63754655daf378cf4a6cce9a76af9dd31d129
Author: Kui LIU <br...@gmail.com>
AuthorDate: Mon Apr 23 16:54:38 2018 +0200

    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 ++--
 .../main/java/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 0bde79b..41e5fc9 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 80642f5..7f41d43 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());

-- 
To stop receiving notification emails like this one, please contact
dahn@apache.org.