Program: 93703
Project: 93703
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.eclipse.emf.ecore.util.EcoreUtil$Copier#copyReference(org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject)
 */
@SuppressWarnings("String_Node_Str") @Override protected void copyReference(EReference eReference,EObject eObject,EObject copyEObject){
  if (!eObject.eIsSet(eReference))   return;
  if (eReference.isMany()) {
    final List<?> referencedObjectsList=(List<?>)eObject.eGet(eReference,resolveProxies);
    if (referencedObjectsList == null)     copyEObject.eSet(getTarget(eReference),null);
 else     if (referencedObjectsList.size() == 0)     copyEObject.eSet(getTarget(eReference),referencedObjectsList);
 else {
      for (      Object referencedEObject : referencedObjectsList) {
        final Object copyReferencedEObject=get(referencedEObject);
        if (copyReferencedEObject != null)         ((List<Object>)copyEObject.eGet(getTarget(eReference))).add(copyReferencedEObject);
 else         if (mergeLinkedDiff((EObject)referencedEObject))         ((List<Object>)copyEObject.eGet(getTarget(eReference))).add(get(referencedEObject));
      }
    }
  }
 else {
    final Object referencedEObject=eObject.eGet(eReference,resolveProxies);
    if (referencedEObject == null)     copyEObject.eSet(getTarget(eReference),null);
 else {
      final Object copyReferencedEObject=get(referencedEObject);
      if (copyReferencedEObject != null)       copyEObject.eSet(getTarget(eReference),copyReferencedEObject);
 else       if (mergeLinkedDiff((EObject)referencedEObject))       copyEObject.eSet(getTarget(eReference),get(referencedEObject));
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.eclipse.emf.ecore.util.EcoreUtil$Copier#copyReference(org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EObject,org.eclipse.emf.ecore.EObject)
 */
@SuppressWarnings("String_Node_Str") @Override protected void copyReference(EReference eReference,EObject eObject,EObject copyEObject){
  if (!eObject.eIsSet(eReference))   return;
  if (eReference.isMany()) {
    final List<?> referencedObjectsList=(List<?>)eObject.eGet(eReference,resolveProxies);
    if (referencedObjectsList == null) {
      copyEObject.eSet(getTarget(eReference),null);
    }
 else     if (referencedObjectsList.size() == 0) {
      copyEObject.eSet(getTarget(eReference),referencedObjectsList);
    }
 else {
      for (      final Object referencedEObject : referencedObjectsList) {
        final Object copyReferencedEObject=get(referencedEObject);
        if (copyReferencedEObject != null) {
          ((List<Object>)copyEObject.eGet(getTarget(eReference))).add(copyReferencedEObject);
        }
 else         if (mergeLinkedDiff((EObject)referencedEObject)) {
          ((List<Object>)copyEObject.eGet(getTarget(eReference))).add(get(referencedEObject));
        }
      }
    }
  }
 else {
    final Object referencedEObject=eObject.eGet(eReference,resolveProxies);
    if (referencedEObject == null) {
      copyEObject.eSet(getTarget(eReference),null);
    }
 else {
      final Object copyReferencedEObject=get(referencedEObject);
      if (copyReferencedEObject != null) {
        copyEObject.eSet(getTarget(eReference),copyReferencedEObject);
      }
 else       if (mergeLinkedDiff((EObject)referencedEObject)) {
        copyEObject.eSet(getTarget(eReference),get(referencedEObject));
      }
    }
  }
}