[jira] [Created] (IO-343) JavaDoc is inconsistent with real codo

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (IO-343) JavaDoc is inconsistent with real codo

AD_LB (Jira)
Igor Lash created IO-343:
----------------------------

             Summary: JavaDoc is inconsistent with real codo
                 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


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<File> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/IO-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Lash updated IO-343:
-------------------------

    Summary: JavaDoc is inconsistent with real code  (was: JavaDoc is inconsistent with real codo)
   

> 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
>
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Gary D. Gregory commented on IO-343:
------------------------------------

Feel free to provide a patch based on trunk code :)
               

> 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
>
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Igor Lash commented on IO-343:
------------------------------

I read like the way of usage of file comparators as described in JavaDoc, so I have changed code. Patch is attached.
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/IO-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Lash updated IO-343:
-------------------------

    Attachment: patch.txt

Fixing inconsistency between code and JavaDocs.
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Igor Lash edited comment on IO-343 at 8/27/12 4:58 PM:
-------------------------------------------------------

I really like the way of usage of file comparators as described in JavaDoc, so I have changed code. Patch is attached.
               
      was (Author: igorlash):
    I read like the way of usage of file comparators as described in JavaDoc, so I have changed code. Patch is attached.
                 

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Gary D. Gregory commented on IO-343:
------------------------------------

This patch breaks compatibility so it could only be considered for a major release. I am not sure we want that now.

Fixing the Javadoc to match the code is OK to do in trunk now but this patch does not do that.

What needs to be decided as usual is if it is the code or the docs that should be fixed.
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Igor Lash commented on IO-343:
------------------------------

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
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

    [ 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (IO-343) JavaDoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

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

Gary D. Gregory commented on IO-343:
------------------------------------

Hm, OK, so the Clirr errors are false positives because the class {{AbstractFileComparator}} implements {{Comparator<File>}}.

Source compatibility is clearly OK (unless you count compiler warnings for the type casting case above).

Binary compatibility should be OK too.
               

> 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (IO-343) org.apache.commons.io.comparator Javadoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/IO-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated IO-343:
-------------------------------

    Summary: org.apache.commons.io.comparator Javadoc is inconsistent with real code  (was: JavaDoc is inconsistent with real code)
   

> org.apache.commons.io.comparator 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
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (IO-343) org.apache.commons.io.comparator Javadoc is inconsistent with real code

AD_LB (Jira)
In reply to this post by AD_LB (Jira)

     [ https://issues.apache.org/jira/browse/IO-343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved IO-343.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

Committed revision 1378539. Applied patch and fixed compiler warnings in tests.
               

> org.apache.commons.io.comparator 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
>             Fix For: 2.5
>
>         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