ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KuiLIU (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ODE-1074) Inconsistent method name
Date Tue, 24 Apr 2018 15:05:00 GMT
KuiLIU created ODE-1074:
---------------------------

             Summary: Inconsistent method name
                 Key: ODE-1074
                 URL: https://issues.apache.org/jira/browse/ODE-1074
             Project: ODE
          Issue Type: Improvement
            Reporter: KuiLIU


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