Item item1 = container.getItem(o1);
Item item2 = container.getItem(o2);
+ /*
+ * Items can be null if the container is filtered. Null is considered
+ * "less" than not-null.
+ */
+ if (item1 == null) {
+ if (item2 == null) {
+ return 0;
+ } else {
+ return 1;
+ }
+ } else if (item2 == null) {
+ return -1;
+ }
+
for (int i = 0; i < sortPropertyIds.length; i++) {
int result = compareProperty(sortPropertyIds[i], sortDirections[i],
super.setUp();\r
}\r
\r
+ public void testFilteredIndexedContainer() {\r
+ IndexedContainer ic = new IndexedContainer();\r
+\r
+ addProperties(ic);\r
+ populate(ic);\r
+\r
+ ic.addContainerFilter(PROPERTY_STRING_ID, "a", true, false);\r
+ ic.sort(new Object[] { PROPERTY_STRING_ID }, new boolean[] { true });\r
+ verifyOrder(ic,\r
+ new String[] { ITEM_ANOTHER_NULL, ITEM_DATA_MINUS1,\r
+ ITEM_DATA_MINUS1_NULL, ITEM_DATA_MINUS2,\r
+ ITEM_DATA_MINUS2_NULL, });\r
+ }\r
+\r
public void testIndexedContainer() {\r
IndexedContainer ic = new IndexedContainer();\r
\r