You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cloudstack.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/01 16:02:00 UTC

[jira] [Commented] (CLOUDSTACK-10365) Inconsistent boolean-related method names

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

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

BruceKuiLiu commented on a change in pull request #2602: CLOUDSTACK-10365: Change the "getXXX" boolean-related method names to…
URL: https://github.com/apache/cloudstack/pull/2602#discussion_r185257981
 
 

 ##########
 File path: api/src/main/java/com/cloud/offering/ServiceOffering.java
 ##########
 @@ -86,7 +86,7 @@
     /**
      * @return Does this service plan support Volatile VM that is, discard VM's root disk and create a new one on reboot?
      */
-    boolean getVolatileVm();
+    boolean isVolatileVm();
 
 Review comment:
   The intention of my pull requests is to make code more readable and understandable, thus further making developers to understand the code more easily with method names without more context information. 
   But about method naming things, developers have two different opinions as you mentioned:
   (1) keep the same naming convention as similar methods.
   (2) make code more readable.
   

----------------------------------------------------------------
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 boolean-related method names
> -----------------------------------------
>
>                 Key: CLOUDSTACK-10365
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10365
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: KuiLIU
>            Priority: Major
>
> These boolean-return methods are named as "getXXX".
> Other boolean-return methods are named as "isXXX".
> Considering there methods will return boolean values, it should be more clear to rename them as "isXXX".
> {code:java}
>      public boolean getEnableRRS() {
>          return enableRRS;
>      }
>     public boolean getEnableRRS() {
>          return enableRRS;
>      }
>      public boolean getShrinkOk() {
>          return shrinkOk;
>      }
>      
>      public boolean getSourceNat() {
>          return sourceNat;
>      }
>      
>      public boolean getInternalLb() {
>          return internalLb;
>      }
>      
>      public boolean getOfferHA() {
>          return offerHA;
>      }
>      
>       public boolean getVolatileVm() {
>          return volatileVm;
>      }
>      
>      public boolean getIsUserDefined() {
>          return isUserDefined;
>      }
>      
>       public boolean getEnablePassword() {
>          return enablePassword;
>      }
>      
>      public boolean getEnableSshKey() {
>          return enableSshKey;
>      }
>      
>      public boolean getUuidTranslation() {
>          return _doUuidTranslation;
>      }
> {code}



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