click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r748851 - in /incubator/click/trunk/click: documentation/docs/roadmap-changes.html framework/src/org/apache/click/control/Column.java framework/test/org/apache/click/control/ColumnCompareTest.java
Date Sat, 28 Feb 2009 13:31:43 GMT
Author: sabob
Date: Sat Feb 28 13:31:42 2009
New Revision: 748851

URL: http://svn.apache.org/viewvc?rev=748851&view=rev
Log:
fixed column sorting. CLK-489

Modified:
    incubator/click/trunk/click/documentation/docs/roadmap-changes.html
    incubator/click/trunk/click/framework/src/org/apache/click/control/Column.java
    incubator/click/trunk/click/framework/test/org/apache/click/control/ColumnCompareTest.java

Modified: incubator/click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/roadmap-changes.html?rev=748851&r1=748850&r2=748851&view=diff
==============================================================================
--- incubator/click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ incubator/click/trunk/click/documentation/docs/roadmap-changes.html Sat Feb 28 13:31:42
2009
@@ -101,6 +101,10 @@
     </div>
     <ul style="padding: 0em; margin-left:0em;margin-bottom: 2em">
       <li class="change">
+          Fixed Column sorting to recognize numbers inside strings
+          [<a target='_blank' href="https://issues.apache.org/click/browse/CLK-489">489</a>].
+      </li>
+      <li class="change">
           Fixed extras <tt>pom.xml</tt> dependencies [<a target='_blank' href="https://issues.apache.org/click/browse/CLK-492">492</a>].
       </li>
     </ul>

Modified: incubator/click/trunk/click/framework/src/org/apache/click/control/Column.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/control/Column.java?rev=748851&r1=748850&r2=748851&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/control/Column.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/control/Column.java Sat Feb
28 13:31:42 2009
@@ -1563,7 +1563,7 @@
          * @return true if a numeric sort should be used
          */
         protected boolean useNumericSort(String value1, String value2) {
-            return NumberUtils.isNumber(value1) && NumberUtils.isNumber(value2);
+            return NumberUtils.isDigits(value1) && NumberUtils.isDigits(value2);
         }
 
         /**

Modified: incubator/click/trunk/click/framework/test/org/apache/click/control/ColumnCompareTest.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/test/org/apache/click/control/ColumnCompareTest.java?rev=748851&r1=748850&r2=748851&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/test/org/apache/click/control/ColumnCompareTest.java
(original)
+++ incubator/click/trunk/click/framework/test/org/apache/click/control/ColumnCompareTest.java
Sat Feb 28 13:31:42 2009
@@ -104,6 +104,20 @@
     }
 
     /**
+     * Check that Column sorting handles edge cases.
+     */
+    public void test_3() {
+        Column column = new Column("name");
+
+        Table table = new Table("table");
+        table.addColumn(column);
+
+        Column.ColumnComparator comparator = new Column.ColumnComparator(column);
+        List rowList = createRowList3();
+        Collections.sort(rowList, comparator);
+    }
+
+    /**
      * Create and return a test Table row list.
      *
      * @return a test Table row list
@@ -150,6 +164,24 @@
     }
 
     /**
+     * Create and return a test Table row list.
+     *
+     * @return a test Table row list
+     */
+    private List createRowList3() {
+        List rowList = new ArrayList();
+
+        rowList.add(createRow("113L - 7 - 107"));
+        rowList.add(createRow("113D - 7 - 107"));
+        rowList.add(createRow("113d - 7 - 107"));
+        rowList.add(createRow("11i3 - 7 - 107"));
+        rowList.add(createRow("105"));
+        rowList.add(createRow("ABC"));
+
+        return rowList;
+    }
+
+    /**
      * Create and return a map representing a Table row.
      *
      * @param value the of the row



Mime
View raw message