Minor formatting.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1437016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-01-22 16:07:33 +00:00
parent 5011f8cabd
commit e1bd0cbfb5
1 changed files with 5 additions and 7 deletions

View File

@ -261,9 +261,7 @@ public class ComparatorChain<E> implements Comparator<E>, Serializable {
* @param o1 the first object to compare * @param o1 the first object to compare
* @param o2 the second object to compare * @param o2 the second object to compare
* @return -1, 0, or 1 * @return -1, 0, or 1
* @exception UnsupportedOperationException * @throws UnsupportedOperationException if the ComparatorChain does not contain at least one Comparator
* if the ComparatorChain does not contain at least one
* Comparator
*/ */
public int compare(final E o1, final E o2) throws UnsupportedOperationException { public int compare(final E o1, final E o2) throws UnsupportedOperationException {
if (isLocked == false) { if (isLocked == false) {
@ -280,7 +278,7 @@ public class ComparatorChain<E> implements Comparator<E>, Serializable {
if (retval != 0) { if (retval != 0) {
// invert the order if it is a reverse sort // invert the order if it is a reverse sort
if (orderingBits.get(comparatorIndex) == true) { if (orderingBits.get(comparatorIndex) == true) {
if(Integer.MIN_VALUE == retval) { if (Integer.MIN_VALUE == retval) {
retval = Integer.MAX_VALUE; retval = Integer.MAX_VALUE;
} else { } else {
retval *= -1; retval *= -1;
@ -340,9 +338,9 @@ public class ComparatorChain<E> implements Comparator<E>, Serializable {
} }
if (object.getClass().equals(this.getClass())) { if (object.getClass().equals(this.getClass())) {
final ComparatorChain<?> chain = (ComparatorChain<?>) object; final ComparatorChain<?> chain = (ComparatorChain<?>) object;
return (null == orderingBits ? null == chain.orderingBits : orderingBits return (null == orderingBits ? null == chain.orderingBits : orderingBits.equals(chain.orderingBits)) &&
.equals(chain.orderingBits)) && (null == comparatorChain ? null == chain.comparatorChain (null == comparatorChain ? null == chain.comparatorChain :
: comparatorChain.equals(chain.comparatorChain)); comparatorChain.equals(chain.comparatorChain));
} }
return false; return false;
} }