Program: 93675
Project: 93675
Buggy source:
/** 
 * Get the all the referenced model objects from the specified difference.
 * @param diff The difference.
 * @return The list of the model objects.
 */
private static Set<EObject> getReferencedEObjects(final DiffElement diff){
  EObject elt=null;
  final Set<EObject> referencedEObjects=new LinkedHashSet<EObject>();
  if (diff instanceof ModelElementChangeLeftTarget) {
    final ModelElementChangeLeftTarget mec=(ModelElementChangeLeftTarget)diff;
    elt=mec.getLeftElement();
    referencedEObjects.addAll(DiffReferenceUtil.getReferencedEObjects(elt,true));
    referencedEObjects.remove(elt);
  }
 else   if (diff instanceof ModelElementChangeRightTarget) {
    final ModelElementChangeRightTarget mec=(ModelElementChangeRightTarget)diff;
    elt=mec.getRightElement();
    referencedEObjects.addAll(DiffReferenceUtil.getReferencedEObjects(elt,true));
    referencedEObjects.remove(elt);
  }
 else   if (diff instanceof ReferenceChangeLeftTarget) {
    final ReferenceChangeLeftTarget rc=(ReferenceChangeLeftTarget)diff;
    final EObject leftTarget=rc.getLeftTarget();
    if (leftTarget != null) {
      referencedEObjects.add(leftTarget);
    }
  }
 else   if (diff instanceof ReferenceChangeRightTarget) {
    final ReferenceChangeRightTarget rc=(ReferenceChangeRightTarget)diff;
    final EObject rightTarget=rc.getRightTarget();
    if (rightTarget != null) {
      referencedEObjects.add(rightTarget);
    }
  }
 else   if (diff instanceof UpdateReference) {
    final UpdateReference ur=(UpdateReference)diff;
    if (ur.getLeftTarget() != null && ur.getLeftTarget() != ur.getLeftElement()) {
      referencedEObjects.add(ur.getLeftTarget());
    }
    if (ur.getRightTarget() != null && ur.getRightTarget() != ur.getRightElement()) {
      referencedEObjects.add(ur.getRightTarget());
    }
  }
  return referencedEObjects;
}

Fixed version (ground truth):
/** 
 * Get the all the referenced model objects from the specified difference.
 * @param diff The difference.
 * @return The list of the model objects.
 */
private static Set<EObject> getReferencedEObjects(final DiffElement diff){
  EObject elt=null;
  final Set<EObject> referencedEObjects=new LinkedHashSet<EObject>();
  if (diff instanceof ModelElementChangeLeftTarget) {
    final ModelElementChangeLeftTarget mec=(ModelElementChangeLeftTarget)diff;
    elt=mec.getLeftElement();
    referencedEObjects.addAll(DiffReferenceUtil.getReferencedEObjects(elt,true));
    referencedEObjects.remove(elt);
  }
 else   if (diff instanceof ModelElementChangeRightTarget) {
    final ModelElementChangeRightTarget mec=(ModelElementChangeRightTarget)diff;
    elt=mec.getRightElement();
    referencedEObjects.addAll(DiffReferenceUtil.getReferencedEObjects(elt,true));
    referencedEObjects.remove(elt);
  }
 else   if (diff instanceof ReferenceChangeLeftTarget) {
    final ReferenceChangeLeftTarget rc=(ReferenceChangeLeftTarget)diff;
    final EObject leftTarget=rc.getLeftTarget();
    if (leftTarget != null) {
      referencedEObjects.add(leftTarget);
    }
  }
 else   if (diff instanceof ReferenceChangeRightTarget) {
    final ReferenceChangeRightTarget rc=(ReferenceChangeRightTarget)diff;
    final EObject rightTarget=rc.getRightTarget();
    if (rightTarget != null) {
      referencedEObjects.add(rightTarget);
    }
  }
 else   if (diff instanceof UpdateReference) {
    final UpdateReference ur=(UpdateReference)diff;
    final EObject leftTarget=ur.getLeftTarget();
    final EObject rightTarget=ur.getRightTarget();
    if (leftTarget != null && leftTarget != ur.getLeftElement()) {
      referencedEObjects.add(leftTarget);
    }
    if (rightTarget != null && rightTarget != ur.getRightElement()) {
      referencedEObjects.add(rightTarget);
    }
  }
  return referencedEObjects;
}