in commons-jcs3-sandbox/commons-jcs3-yajcache/src/main/java/org/apache/commons/jcs/yajcache/util/EqualsUtils.java [34:76]
public boolean equals(Object lhs, Object rhs) {
if (lhs == rhs)
return true;
if (lhs == null || rhs == null)
return false;
Class lClass = lhs.getClass();
Class rClass = rhs.getClass();
if (lClass.isArray()
&& rClass.isArray())
{
Class lCompType = lClass.getComponentType();
Class rCompType = rClass.getComponentType();
if (lCompType.isPrimitive()) {
if (rCompType.isPrimitive()) {
if (lCompType != rCompType)
return false;
if (lCompType == int.class)
return Arrays.equals((int[])lhs, (int[])rhs);
if (lCompType == boolean.class)
return Arrays.equals((boolean[])lhs, (boolean[])rhs);
if (lCompType == byte.class)
return Arrays.equals((byte[])lhs, (byte[])rhs);
if (lCompType == char.class)
return Arrays.equals((char[])lhs, (char[])rhs);
if (lCompType == double.class)
return Arrays.equals((double[])lhs, (double[])rhs);
if (lCompType == float.class)
return Arrays.equals((float[])lhs, (float[])rhs);
if (lCompType == long.class)
return Arrays.equals((long[])lhs, (long[])rhs);
if (lCompType == short.class)
return Arrays.equals((short[])lhs, (short[])rhs);
}
return false;
}
if (rCompType.isPrimitive())
return false;
return Arrays.equals((Object[])lhs, (Object[])rhs);
}
return lhs.equals(rhs);
}