You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Furkan KAMACI (JIRA)" <ji...@apache.org> on 2014/03/08 16:35:42 UTC
[jira] [Created] (SOLR-5836) CSVConfig Invalid Check For Equals
Furkan KAMACI created SOLR-5836:
-----------------------------------
Summary: CSVConfig Invalid Check For Equals
Key: SOLR-5836
URL: https://issues.apache.org/jira/browse/SOLR-5836
Project: Solr
Issue Type: Bug
Affects Versions: 4.6.1, 4.7
Reporter: Furkan KAMACI
Priority: Minor
Fix For: 4.8
Attachments: SOLR-5836.patch
When I was checking the source code of Solr I realized that equals method at CSVConfig.java does an unnecessary or invalid checking as follows:
{code}
/**
* TODO..
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (obj == null && !(obj instanceof CSVConfig)) {
return false;
}
return super.equals(obj);
// CSVConfig config = (CSVConfig) obj;
// getFill() == config.getFill()
// getFields().equals(config.getFields())
}
{code}
if obj is null it can not be an instance of CSVConfig so it is unnecessary. On the other hand it does not make a valid check so I have changed the equals criteria to OR.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org