ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KuiLIU (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (ODE-1074) Inconsistent method name
Date Tue, 13 Nov 2018 08:03:00 GMT

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

Mime
View raw message