CASSANDRA-862 Replace usage of FBUtilities.equals with apache-commons equivalent. Patch by Gabriele Renzi, reviewed by Gary Dusbabek.

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@920537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Dusbabek 2010-03-08 22:00:51 +00:00
parent 6d785c1841
commit af399a537f
3 changed files with 7 additions and 15 deletions

View File

@ -31,6 +31,8 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.lang.ObjectUtils;
public final class CFMetaData
{
public final static double DEFAULT_KEY_CACHE_SIZE = 0.1;
@ -156,8 +158,8 @@ public final class CFMetaData
&& other.cfName.equals(cfName)
&& other.columnType.equals(columnType)
&& other.comparator.equals(comparator)
&& FBUtilities.equals(other.subcolumnComparator, subcolumnComparator)
&& FBUtilities.equals(other.comment, comment)
&& ObjectUtils.equals(other.subcolumnComparator, subcolumnComparator)
&& ObjectUtils.equals(other.comment, comment)
&& other.rowCacheSize == rowCacheSize
&& other.keyCacheSize == keyCacheSize
&& other.cfId == cfId;

View File

@ -20,7 +20,6 @@ package org.apache.cassandra.config;
import org.apache.cassandra.locator.AbstractReplicationStrategy;
import org.apache.cassandra.locator.IEndPointSnitch;
import org.apache.cassandra.utils.FBUtilities;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
@ -31,6 +30,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang.ObjectUtils;
public final class KSMetaData
{
public final String name;
@ -59,7 +60,7 @@ public final class KSMetaData
return false;
KSMetaData other = (KSMetaData)obj;
return other.name.equals(name)
&& FBUtilities.equals(other.strategyClass, strategyClass)
&& ObjectUtils.equals(other.strategyClass, strategyClass)
&& other.replicationFactor == replicationFactor
&& sameEpSnitch(other, this)
&& other.cfMetaData.size() == cfMetaData.size()

View File

@ -452,15 +452,4 @@ public class FBUtilities
}
}
public static boolean equals(Object a, Object b)
{
if (a == null && b == null)
return true;
else if (a != null && b == null)
return false;
else if (a == null && b != null)
return false;
else
return a.equals(b);
}
}