Author: lfryc(a)redhat.com
Date: 2011-01-11 06:34:09 -0500 (Tue, 11 Jan 2011)
New Revision: 20941
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/SelectItemComparator.java
Log:
sort null as first of SelectItems in Attributes list
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/SelectItemComparator.java
===================================================================
---
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/SelectItemComparator.java 2011-01-11
11:33:35 UTC (rev 20940)
+++
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/SelectItemComparator.java 2011-01-11
11:34:09 UTC (rev 20941)
@@ -46,9 +46,13 @@
* {@inheritDoc}
*/
public int compare(SelectItem o1, SelectItem o2) {
- if (o1 == null || o1.getLabel() == null) {
+ if (o1 == null || o1.getLabel() == null ||
o1.getLabel().equals("null")) {
return -1;
}
+
+ if (o2 == null || o2.getLabel() == null ||
o2.getLabel().equals("null")) {
+ return 1;
+ }
return o1.getLabel().compareTo(o2.getLabel());
}
Show replies by date