You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by "KuiLIU (JIRA)" <ji...@apache.org> on 2018/11/13 08:03:00 UTC
[jira] [Resolved] (ODE-1074) Inconsistent method name
[ https://issues.apache.org/jira/browse/ODE-1074?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
KuiLIU resolved ODE-1074.
-------------------------
Resolution: Fixed
> Inconsistent method name
> ------------------------
>
> Key: ODE-1074
> URL: https://issues.apache.org/jira/browse/ODE-1074
> Project: ODE
> Issue Type: Improvement
> Reporter: KuiLIU
> Priority: Major
>
> The following method is named "contains" that seems to asking whether the Collection c contains the object t1 or not, and the answer is true or false.
> Actually, the method tries to find an element in the Collection c with the Object t1 and returns it.
> Thus, this method should be renamed "find" that would be more clear.
> {code:java}
> private Object contains(Collection c, Object t1) {
> Iterator itor = c.iterator();
> Object t2;
> logFalseThrough = true;
> while (itor.hasNext()){
> t2 = itor.next();
> if (deepEquals(t1, t2)) {
> logFalseThrough = false;
> return t2;
> }
> }
> logFalseThrough = false;
> return null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)