From 4c71dedc3a7899f7233b7bbdb6b40535f685f66e Mon Sep 17 00:00:00 2001 From: Rodney Waldhoff Date: Tue, 7 Jan 2003 18:20:07 +0000 Subject: [PATCH] cosmetic changes only (convert tabs to spaces, add braces one line blocks) git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130916 13f79535-47bb-0310-9956-ffa450edef68 --- .../comparators/NullComparator.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/java/org/apache/commons/collections/comparators/NullComparator.java b/src/java/org/apache/commons/collections/comparators/NullComparator.java index a8bf3dcf9..d2378b448 100644 --- a/src/java/org/apache/commons/collections/comparators/NullComparator.java +++ b/src/java/org/apache/commons/collections/comparators/NullComparator.java @@ -62,7 +62,7 @@ import java.util.Comparator; * other objects. * * @author Michael A. Smith - * @version $Id: NullComparator.java,v 1.4 2002/10/12 22:15:21 scolebourne Exp $ + * @version $Revision: 1.5 $ $Date: 2003/01/07 18:20:07 $ **/ public class NullComparator implements Comparator, Serializable { @@ -84,7 +84,7 @@ public class NullComparator implements Comparator, Serializable { * used. **/ public NullComparator() { - this(ComparableComparator.getInstance(), true); + this(ComparableComparator.getInstance(), true); } /** @@ -101,7 +101,7 @@ public class NullComparator implements Comparator, Serializable { * null **/ public NullComparator(Comparator nonNullComparator) { - this(nonNullComparator, true); + this(nonNullComparator, true); } /** @@ -117,7 +117,7 @@ public class NullComparator implements Comparator, Serializable { * non-null object. **/ public NullComparator(boolean nullsAreHigh) { - this(ComparableComparator.getInstance(), nullsAreHigh); + this(ComparableComparator.getInstance(), nullsAreHigh); } /** @@ -140,12 +140,12 @@ public class NullComparator implements Comparator, Serializable { * null **/ public NullComparator(Comparator nonNullComparator, boolean nullsAreHigh) { - this.nonNullComparator = nonNullComparator; - this.nullsAreHigh = nullsAreHigh; - - if(nonNullComparator == null) { - throw new NullPointerException("null nonNullComparator"); - } + this.nonNullComparator = nonNullComparator; + this.nullsAreHigh = nullsAreHigh; + + if(nonNullComparator == null) { + throw new NullPointerException("null nonNullComparator"); + } } /** @@ -167,10 +167,10 @@ public class NullComparator implements Comparator, Serializable { * 0 if o1 and o2 are equal. **/ public int compare(Object o1, Object o2) { - if(o1 == o2) return 0; - if(o1 == null) return (this.nullsAreHigh ? 1 : -1); - if(o2 == null) return (this.nullsAreHigh ? -1 : 1); - return this.nonNullComparator.compare(o1, o2); + if(o1 == o2) { return 0; } + if(o1 == null) { return (this.nullsAreHigh ? 1 : -1); } + if(o2 == null) { return (this.nullsAreHigh ? -1 : 1); } + return this.nonNullComparator.compare(o1, o2); } /** @@ -180,7 +180,7 @@ public class NullComparator implements Comparator, Serializable { * @return a hash code for this comparator. **/ public int hashCode() { - return (nullsAreHigh ? -1 : 1) * nonNullComparator.hashCode(); + return (nullsAreHigh ? -1 : 1) * nonNullComparator.hashCode(); } /** @@ -195,14 +195,14 @@ public class NullComparator implements Comparator, Serializable { * non-null object comparators. **/ public boolean equals(Object obj) { - if(obj == null) return false; - if(obj == this) return true; - if(!obj.getClass().equals(this.getClass())) return false; + if(obj == null) { return false; } + if(obj == this) { return true; } + if(!obj.getClass().equals(this.getClass())) { return false; } - NullComparator other = (NullComparator)obj; + NullComparator other = (NullComparator)obj; - return ((this.nullsAreHigh == other.nullsAreHigh) && - (this.nonNullComparator.equals(other.nonNullComparator))); + return ((this.nullsAreHigh == other.nullsAreHigh) && + (this.nonNullComparator.equals(other.nonNullComparator))); } private static final long serialVersionUID = -5820772575483504339L;