cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-10359) Inconsistent method names
Date Mon, 23 Apr 2018 10:19:00 GMT

    [ https://issues.apache.org/jira/browse/CLOUDSTACK-10359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16447907#comment-16447907
] 

ASF GitHub Bot commented on CLOUDSTACK-10359:
---------------------------------------------

BruceKuiLiu closed pull request #2591: CLOUDSTACK-10359: Change the inconsistent method names.
URL: https://github.com/apache/cloudstack/pull/2591
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 String getHostTag() {
         return hostTag;
     }
 
-    public Boolean getIsSystem() {
+    public Boolean isSystem() {
         return isSystem == null ? false : isSystem;
     }
 
@@ -210,7 +210,7 @@ public String getDeploymentPlanner() {
         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 ServiceOffering createServiceOffering(final CreateServiceOfferingCmd
cmd)
 
         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 ServiceOffering createServiceOffering(final CreateServiceOfferingCmd
cmd)
             }
         }
 
-        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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Inconsistent method names
> -------------------------
>
>                 Key: CLOUDSTACK-10359
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10359
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: KuiLIU
>            Priority: Major
>
> The following 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.
> {code:java}
>     public boolean getCustomized() {
>         return (cpuNumber == null || memory == null || cpuSpeed == null);
>     }
>    public Boolean getIsSystem() {
>         return isSystem == null ? false : isSystem;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message