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-10364) Inconsiste "setXXX" method names.
Date Fri, 27 Apr 2018 22:02:00 GMT

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

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

DaanHoogland commented on a change in pull request #2601: CLOUDSTACK-10364: Change the "setXXX"
method names to "getXXX".
URL: https://github.com/apache/cloudstack/pull/2601#discussion_r184816424
 
 

 ##########
 File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
 ##########
 @@ -298,11 +298,11 @@ public void detach(LibvirtVMDef.InterfaceDef iface) {
         Script.runSimpleBashScript("test -d /sys/class/net/" + iface.getBrName() + "/brif/"
+ iface.getDevName() + " && brctl delif " + iface.getBrName() + " " + iface.getDevName());
     }
 
-    private String setVnetBrName(String pifName, String vnetId) {
+    private String getVnetBrName(String pifName, String vnetId) {
 
 Review comment:
   i dont think getVnetBrName() is a good name, what it does is format/generate/create a vnetBrName!
not get it from somewhere.

----------------------------------------------------------------
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


> Inconsiste "setXXX" method names.
> ---------------------------------
>
>                 Key: CLOUDSTACK-10364
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10364
>             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 as "setXXX",
> actually, they are not setter but getter.
> Thus, they should be renamed as "getXXX".
> {code:java}
>  private String setVnetBrName(String pifName, String vnetId) {
>         return "br" + pifName + "-" + vnetId;
>     }
>     private String setVxnetBrName(String pifName, String vnetId) {
>         return "brvx-" + vnetId;
>     }
> {code}



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

Mime
View raw message