Repository: oodt Updated Branches: refs/heads/master 905c96a95 -> 96842a429
OODT-907 remove co Project: http://git-wip-us.apache.org/repos/asf/oodt/repo Commit: http://git-wip-us.apache.org/repos/asf/oodt/commit/96842a42 Tree: http://git-wip-us.apache.org/repos/asf/oodt/tree/96842a42 Diff: http://git-wip-us.apache.org/repos/asf/oodt/diff/96842a42 Branch: refs/heads/master Commit: 96842a429a5ec4bb26fc6d7ce94a5644be3d665f Parents: 905c96a Author: Tom Barber <[email protected]> Authored: Sun Oct 25 23:13:47 2015 +0000 Committer: Tom Barber <[email protected]> Committed: Sun Oct 25 23:13:47 2015 +0000 ---------------------------------------------------------------------- .../oodt/cas/filemgr/structs/query/QueryResultComparator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oodt/blob/96842a42/filemgr/src/main/java/org/apache/oodt/cas/filemgr/structs/query/QueryResultComparator.java ---------------------------------------------------------------------- diff --git a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/structs/query/QueryResultComparator.java b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/structs/query/QueryResultComparator.java index 9bab383..9552d11 100644 --- a/filemgr/src/main/java/org/apache/oodt/cas/filemgr/structs/query/QueryResultComparator.java +++ b/filemgr/src/main/java/org/apache/oodt/cas/filemgr/structs/query/QueryResultComparator.java @@ -45,9 +45,11 @@ public class QueryResultComparator implements Comparator<QueryResult> { public int compare(QueryResult qr1, QueryResult qr2) { String m1 = qr1.getMetadata().getMetadata(sortByMetKey); String m2 = qr2.getMetadata().getMetadata(sortByMetKey); - if (m1.equals(m2)) + if (m1 == m2) return 0; // return null last, since they are the least interesting + if (m1 == null) + return 1; if (m2 == null) return -1; return m1.compareTo(m2);
