Checks if two values are equal. The operation can be performed over values of
any type.

@param value1 the first value to compare
@param value2 the second value to compare
@return true if values are equal and false otherwise
420461
public static boolean areEqual(Object value1, Object value2) {
		if (value1 == null && value2 == null)
			return true;
		if (value1 == null || value2 == null)
			return false;
		return value1.equals(value2);
	}
435874
protected static boolean numericEquals(Field vector1, Field vector2) {
		if (vector1.size() != vector2.size())
			return false;
		if (vector1.isEmpty())
			return true;

		Iterator<Object> it1 = vector1.iterator();
		Iterator<Object> it2 = vector2.iterator();

		while (it1.hasNext()) {
			Object obj1 = it1.next();
			Object obj2 = it2.next();

			if (!(obj1 instanceof Number && obj2 instanceof Number))
				return false;

			if (((Number) obj1).doubleValue() != ((Number) obj2).doubleValue())
				return false;
		}

		return true;
	}
1036764
private boolean canCompare(CheckBox check1, CheckBox check2) {

        return !((check1 == null) || (check2 == null) || (check1.getData() == check2.getData()));
    }
1089530
public static boolean isValueEquals(BigDecimal decimal1, BigDecimal decimal2) {
		if (decimal1 == null && decimal2 == null) return true;
		if (decimal1 == null && decimal2 != null) return false;
		if (decimal1 != null && decimal2 == null) return false;
		return cutInvalidSacle(decimal1).equals(cutInvalidSacle(decimal2));
	}
195587
public static boolean equal(final Throwable ex1, final Throwable ex2) {
        if (ex1 == ex2) {
            return true;
        }
        if (ex1 == null) {
            if (ex2 != null) {
                return false;
            }
        } else if (ex2 == null) {
            if (ex1 != null) {
                return false;
            }
        } else {
            if (ex1.getClass() != ex2.getClass()) {
                return false;
            }
            if (ex1.getMessage() == null) {
                if (ex2.getMessage() != null) {
                    return false;
                }
            } else if (!ex1.getMessage().equals(ex2.getMessage())) {
                return false;
            }
            if (!equal(ex1.getCause(), ex2.getCause())) {
                return false;
            }
        }
        return true;
    }
134812
private static boolean doEquals(DerValue d1, DerValue d2) {
        synchronized (d1.data) {
            synchronized (d2.data) {
                d1.data.reset();
                d2.data.reset();
                return d1.buffer.equals(d2.buffer);
            }
        }
    }
14131
public static <T> boolean equalsE(T a, T b) {
        if (a == null && b == null) {
            return true;
        }
        if (a != null && b == null) {
            return false;
        }
        if (a == null) {
            return false;
        }
        return a.equals(b);
    }
744535
public static boolean varInsnEqual(VarInsnNode insn1, VarInsnNode insn2)
	{
		if (insn1.var == -1 || insn2.var == -1)
			return true;

		return insn1.var == insn2.var;
	}
901341
public boolean equal(final Object o1,
                         Object o2) {
        if ( o1 == o2 ) {
            return true;
            
        }
        // o1 is a FactHandle, so just check their id's are the same
        if ( o1 instanceof FactHandle ) {
            return ((InternalFactHandle)o1).getId() == ((InternalFactHandle)o2).getId() ;
        }

        // o1 is an object, so unwrap o2 for comparison
        final InternalFactHandle handle = ((InternalFactHandle) o2);
        o2 = handle.getObject();
        return o1 == o2 || o2.equals( o1 );
    }
1094562
private static boolean numbersEqual(Number a, Number b) {
        if (a.equals(b)) {
            return true;
        }
        if (a.doubleValue() == b.doubleValue()) {
            return true;
        }
        return false;
    }
403721
public static boolean equal(Object obj1, Object obj2) {
        if (obj1 == obj2) {
            return true;
        }
        if (obj1 == null || obj2 == null) {
            return false;
        }
        if (obj1.getClass().isArray()) {
            return equalsArray(obj1, obj2);
        }
        // this does not handle arrays embedded in objects, such as in lists/maps
        // but you shouldn't use arrays like that, should you?
        return obj1.equals(obj2);
    }
581102
protected final boolean compareKeys(K k1, K k2) {
        return k1 == k2 || (k1 != null && k1.equals(k2));
    }
1189129
protected static boolean areEqualEventSubscriptions(EventSubscriptionEntity subscription1, EventSubscriptionEntity subscription2) {
    return valuesEqual(subscription1.getEventType(), subscription2.getEventType())
        && valuesEqual(subscription1.getEventName(), subscription2.getEventName())
        && valuesEqual(subscription1.getActivityId(), subscription2.getActivityId());

  }
523673
public static boolean notEquals(final Object object1, final Object object2) {
        return object1 != null && !object1.equals(object2) || object1 == null && object2 != null;
    }
1021061
public static boolean areEqual(byte[] array1, byte[] array2) {
		if (array1.length != array2.length) return false;

		for (int i=0; i<array1.length; ++i)
			if (array1[i] != array2[i]) return false;

		return true;
	}
367043
public static boolean isEqualOrNull( Map s1,
                                         Map s2 ) {
        if ( s1 == null
                && s2 == null ) {
            return true;
        } else if ( s1 != null
                && s2 != null
                && s1.size() == s2.size() ) {
            return true;
        }
        return false;
    }
1159808
public boolean isEqual(Object value) {
	    if (value == null)
	        return false;
	    else if (this == value)
	        return true;
	    else {
	        Num tmp = null;
	        if (value instanceof Num)
	            tmp = (Num)value;
	        else
	            tmp = new Num(value);
	        
	        int i = tmp.toBigDecimal().compareTo(this.toBigDecimal());
            if (i == 0)
                return true;
            else
                return false;
	    }
	}