#58 caseinsensitive sort changes case of list elements

closed
nobody
None
5
2004-02-09
2004-01-23
No

With the casesensitive flag set to false the SortList task
changes the case of the whole list to lowercase:

<property name="my.list" value="E,C,d,b,a" />
<sortlist casesensitive="false" property="my.
sorted.list" value="${my.list}"/>
<echo message="${my.sorted.list}" />

Results in:
[echo] a,b,c,d,e

I expected the output to be: a,b,C,d,E

The problem can also be reproduced using the JUnit test I
have attached to this bug report. Note that you have to
remove the 'final' modifier of AbstractPropertySetterTask
for the test to compile.

Also when looking at the implementation of SortList I
think it would be a good idea to use java.util.Arrays.
sort(Object[], Comparator) to implement this feature.

Discussion

  • Markus Gebhard

    Markus Gebhard - 2004-01-23

    JUnit test demonstrating the bug

     
  • Matt Inger

    Matt Inger - 2004-02-09
    • status: open --> closed
     
  • Matt Inger

    Matt Inger - 2004-02-09

    Logged In: YES
    user_id=83032

    This has been fixed. However, we cannot yet use
    java.util.Arrays or Comparator, as we're trying to keep it
    compatibile with jdk 1.1, until such time as we are fully
    dependant on ANT 1.6 (which finally supports JDK 1.2)

    net/sf/antcontrib/property/SortList.java

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks