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-10360) Inconsistent method name
Date Tue, 24 Apr 2018 10:10:00 GMT

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

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

rafaelweingartner commented on a change in pull request #2598: CLOUDSTACK-10360: Change the
method name.
URL: https://github.com/apache/cloudstack/pull/2598#discussion_r183675863
 
 

 ##########
 File path: framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java
 ##########
 @@ -166,7 +166,7 @@ public ConfigurationDao global() {
         return _configDao;
     }
 
-    public ScopedConfigStorage scoped(ConfigKey<?> config) {
+    public ScopedConfigStorage findStorage(ConfigKey<?> config) {
 
 Review comment:
   I would use something like `findScopedConfigStorage`. This `findStorage` can be confused
with find storage pool.

----------------------------------------------------------------
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 name
> ------------------------
>
>                 Key: CLOUDSTACK-10360
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10360
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: KuiLIU
>            Priority: Major
>
> The following method is named as "scoped" that seems to whether the variable config is
scoped in _scopedStorages or not.
> Actually, the method tries to find a storage of which scope equals to the scope of config.
> So that, the method name "findStorage" should be more clear than "scoped".
> {code:java}
>     public ScopedConfigStorage scoped(ConfigKey<?> config) {
>         for (ScopedConfigStorage storage : _scopedStorages) {
>             if (storage.getScope() == config.scope()) {
>                 return storage;
>             }
>         }
>         throw new CloudRuntimeException("Unable to find config storage for this scope:
" + config.scope() + " for " + config.key());
>     }
> {code}



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

Mime
View raw message