/** * <p>Returns true if two annotated objects are equal. The generic way to do the check * is:</p> * a) If they have the same AC, consider them equal<br/> * b) Otherwise, clone both objects (excluding the ACs) and invoke equals() on them */ protected boolean areEqual(AnnotatedObject source, AnnotatedObject target) { if (source instanceof CvObject && areCvObjectsEqual((CvObject)source, (CvObject)target)) { return true; } else if (source instanceof Interaction && areInteractionsEqual((Interaction)source, (Interaction)target)) { return true; } // clone both source and target to try a perfect equals on them try { if (clone(source).equals(clone(target))) { return true; } } catch (IntactClonerException e) { throw new PersisterException("Problem cloning source or target, to check if they are equal", e); } return false; }
/** * <p>Returns true if two annotated objects are equal. The generic way to do the check * is:</p> * a) If they have the same AC, consider them equal<br/> * b) Otherwise, clone both objects (excluding the ACs) and invoke equals() on them */ protected boolean areEqual(AnnotatedObject source, AnnotatedObject target) { if (source instanceof CvObject && areCvObjectsEqual((CvObject)source, (CvObject)target)) { return true; } else if (source instanceof Interaction && areInteractionsEqual((Interaction)source, (Interaction)target)) { return true; } // clone both source and target to try a perfect equals on them try { if (clone(source).equals(clone(target))) { return true; } } catch (IntactClonerException e) { throw new PersisterException("Problem cloning source or target, to check if they are equal", e); } return false; }