commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Lash (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IO-343) JavaDoc is inconsistent with real code
Date Wed, 29 Aug 2012 06:06:08 GMT

    [ https://issues.apache.org/jira/browse/IO-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13443834#comment-13443834
] 

Igor Lash edited comment on IO-343 at 8/29/12 5:05 PM:
-------------------------------------------------------

This patch will not break backward compatibility. There will be unnecessary cast if someone
used comparator in the way 


((NameFileComparator)NameFileComparator.NAME_COMPARATOR).sort(list)


                
      was (Author: igorlash):
    This patch will not break backward compatibility. There will be unnecessary cast if someone
used comparator in the way 

[[
((NameFileComparator)NameFileComparator.NAME_COMPARATOR).sort(list)
]]

                  
> JavaDoc is inconsistent with real code
> --------------------------------------
>
>                 Key: IO-343
>                 URL: https://issues.apache.org/jira/browse/IO-343
>             Project: Commons IO
>          Issue Type: Bug
>    Affects Versions: 2.4
>            Reporter: Igor Lash
>            Priority: Minor
>         Attachments: patch.txt
>
>
> Package org.apache.commons.io.comparator has a lot of inconsistent JavaDocs. 
> For example this class org.apache.commons.io.comparator.NameFileComparator
> http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/NameFileComparator.java?view=markup
> has JavaDocs
>  List&lt;File&gt; list = ...
>  NameFileComparator.NAME_COMPARATOR.sort(list); ....
>  File[] array = ...
>  NameFileComparator.NAME_INSENSITIVE_REVERSE.sort(array);
> but this will not work because all static members of NameFileComparator declared as Comparator<File>
for example 
>  public static final Comparator<File> NAME_REVERSE = new ReverseComparator(NAME_COMPARATOR);
> public static final Comparator<File> NAME_INSENSITIVE_REVERSE = new ReverseComparator(NAME_INSENSITIVE_COMPARATOR);
> and Comparator class doesn't have the sort() method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message