jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject svn commit: r1446513 - in /jackrabbit/branches/2.6/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/query/lucene/Util.java test/java/org/apache/jackrabbit/core/query/lucene/UtilTest.java
Date Fri, 15 Feb 2013 11:08:41 GMT
Author: unico
Date: Fri Feb 15 11:08:41 2013
New Revision: 1446513

URL: http://svn.apache.org/r1446513
Log:
JCR-3521 backport: fix comparable contract violation which breaks search sort on Java 7: applying
patch by Chetan Mehrotra

Added:
    jackrabbit/branches/2.6/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/UtilTest.java
      - copied unchanged from r1446512, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/UtilTest.java
Modified:
    jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java

Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java?rev=1446513&r1=1446512&r2=1446513&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
(original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Util.java
Fri Feb 15 11:08:41 2013
@@ -257,6 +257,9 @@ public class Util {
      * consistent
      */
     public static int compare(Comparable<?>[] c1, Comparable<?>[] c2) {
+        if(c1 == null && c2 == null){
+            return 0;
+        }
         if (c1 == null) {
             return -1;
         }
@@ -280,6 +283,9 @@ public class Util {
      * consistent
      */
     public static int compare(Value[] a, Value[] b) throws RepositoryException {
+        if(a == null && b == null){
+            return 0;
+        }
         if (a == null) {
             return -1;
         }



Mime
View raw message