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-10363) Inconsistent "getXXX" and "listXXX" method names.
Date Tue, 24 Apr 2018 11:58:01 GMT

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

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

BruceKuiLiu commented on issue #2599: CLOUDSTACK-10363: Change the "getXXX" and "listXXX"
method names to "…
URL: https://github.com/apache/cloudstack/pull/2599#issuecomment-383904258
 
 
   Hi @nitin-maharana ,
   I think that #2600, #2061, #2602 can be classified into three different changes.
   If it is necessary, I will merge them into one commit.

----------------------------------------------------------------
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 "getXXX" and "listXXX" method names.
> -------------------------------------------------
>
>                 Key: CLOUDSTACK-10363
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the default.) 
>            Reporter: KuiLIU
>            Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
>     @Override
>     public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
>         SearchCriteria<OvsTunnelInterfaceVO> sc = hostAndLabelSearch.create();
>         sc.setParameters("host_id", hostId);
>         sc.setParameters("label", label);
>         return findOneBy(sc);
>     }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
>     private List<CommandExecLogVO> listActiveCommands(long dcId, Date cutTime)
{
>         SearchCriteria<CommandExecLogVO> sc = activeCommandSearch.create();
>         sc.setParameters("created", cutTime);
>         sc.setJoinParameters("hostSearch", "dc", dcId);
>         sc.setJoinParameters("hostSearch", "status", Status.Up);
>         return _cmdExecLogDao.search(sc, null);
>     }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
>     private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
>         if (_jobDispatchers != null) {
>             List<AsyncJobJoinMapVO> joinRecords = _joinMapDao.listJoinRecords(job.getId());
>             if (joinRecords.size() > 0) {
>                 AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
>                 for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
>                     if (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
>                         return dispatcher;
>                 }
>             } else {
>                 s_logger.warn("job-" + job.getId() + " is scheduled for wakeup run, but
there is no joining info anymore");
>             }
>         }
>         return null;
>     }
> {code}



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

Mime
View raw message