You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2014/03/08 23:25:42 UTC
[jira] [Commented] (SOLR-5836) CSVConfig Invalid Check For Equals
[ https://issues.apache.org/jira/browse/SOLR-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925032#comment-13925032 ]
Yonik Seeley commented on SOLR-5836:
------------------------------------
This is just inherited code from commons-csv. Solr does not cache/check CSV config objects.
You should probably open a commons-csv issue to fix it there.
> 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, 5.0
>
> 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