[ https://issues.apache.org/jira/browse/SOLR-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925039#comment-13925039 ]
Furkan KAMACI commented on SOLR-5836: ------------------------------------- I see that commons-csv does not include such kind of code anymore. > 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-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org