JCR-3521 backport: fix comparable contract violation which breaks search sort on Java 7: applying patch by Chetan Mehrotra

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.6@1446513 13f79535-47bb-0310-9956-ffa450edef68