mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niklas Gustavsson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FTPSERVER-375) [FindBugs] NativeFtpFile implements equals(), but does not - hashCode()
Date Sun, 19 Jun 2011 11:58:47 GMT

    [ https://issues.apache.org/jira/browse/FTPSERVER-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13051676#comment-13051676

Niklas Gustavsson commented on FTPSERVER-375:

Yes, we do use equals() so that's required to work as before. Not so worried about speed,
as the equals (currently at least) check goes hand in hand with a lot of other I/O. 

Agreed that the hashCode() implementation can be simplified, will fix. 

On the case that the canonical file might change, that seems consistent with that equals()
will also change in this case. 

All of this said, we do not currently use FtpFile in a hash map as far as I know, so it's
a bit theoretical.

> [FindBugs] NativeFtpFile implements equals(), but does not - hashCode()
> -----------------------------------------------------------------------
>                 Key: FTPSERVER-375
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-375
>             Project: FtpServer
>          Issue Type: Wish
>          Components: Core
>            Reporter: Sergey Vladimirov
>            Priority: Minor
>              Labels: equality, findbugs
>             Fix For: 1.0.6, 1.1.0
> In fact, i can't find why it need to implement equals() in first place. If for any map
- then hashCode() will also be required. For example, this.file.getCanonicalFile().hashCode()
> Anyway, could we please have a comment why do we need equals() method? :)

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message