racorn commented on issue #6433: URL: https://github.com/apache/pulsar/issues/6433#issuecomment-1344208902
@tisonkun It is correct that in general `compareTo` is not symmetric, but `a.compareTo(b) == 0` implies that `b.compareTo(a)` should be 0 as well. Javadoc for Comparable.compareTo states **The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x))for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)** If I remember correctly, that requirement was not fulfilled for the test data in the original description. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
