Josh Bloch writes:
The Comparable.compareTo doc says:
In the foregoing description, the notation sgn(expression)
designates the mathematical signum function, which is defined to
return one of -1, 0, or 1 according to whether the value of expression
is negative, zero or positive. 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.)
It looks like the first sentence of this paragraph should be moved to the end.
The Comparable.compareTo doc says:
In the foregoing description, the notation sgn(expression)
designates the mathematical signum function, which is defined to
return one of -1, 0, or 1 according to whether the value of expression
is negative, zero or positive. 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.)
It looks like the first sentence of this paragraph should be moved to the end.