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

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

rhtyd closed pull request #2601: CLOUDSTACK-10364: Change the "setXXX" method 
names to "getXXX".
URL: https://github.com/apache/cloudstack/pull/2601
 
 
   

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/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
index 11b22c494f4..88e473d18eb 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
+++ 
b/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 generateVnetBrName(String pifName, String vnetId) {
         return "br" + pifName + "-" + vnetId;
     }
 
-    private String setVxnetBrName(String pifName, String vnetId) {
+    private String generateVxnetBrName(String pifName, String vnetId) {
         return "brvx-" + vnetId;
     }
 
@@ -317,9 +317,9 @@ private String createVnetBr(String vNetId, String pifKey, 
String protocol) throw
         }
         String brName = "";
         if (protocol.equals(Networks.BroadcastDomainType.Vxlan.scheme())) {
-            brName = setVxnetBrName(nic, vNetId);
+            brName = generateVxnetBrName(nic, vNetId);
         } else {
-            brName = setVnetBrName(nic, vNetId);
+            brName = generateVnetBrName(nic, vNetId);
         }
         createVnet(vNetId, nic, brName, protocol);
         return brName;
diff --git 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java
 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java
index 8e73d859039..5f21b9662cc 100644
--- 
a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java
+++ 
b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/IvsVifDriver.java
@@ -168,12 +168,12 @@ private String createVnetBr(String vNetId, String pifKey, 
String protocol) throw
             }
         }
         String brName = "";
-        brName = setVnetBrName(nic, vNetId);
+        brName = generateVnetBrName(nic, vNetId);
         createVnet(vNetId, nic, brName, protocol);
         return brName;
     }
 
-    private String setVnetBrName(String pifName, String vnetId) {
+    private String generateVnetBrName(String pifName, String vnetId) {
         return "br" + pifName + "-" + vnetId;
     }
 


 

----------------------------------------------------------------
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:
us...@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)

Reply via email to