Program: 93649
Project: 93649
Buggy source:
/** 
 * This will be called from   {@link #checkConflict(Comparison,Diff,Iterable)} in order to detectconflicts on a Diff that is of type "ADD" and which is <b>not</b> a containment reference change. <p> These will conflict with Diffs on the other side on the same reference in the same container, of type ADD an on the same value. </p>
 * @param comparison The originating comparison of those diffs.
 * @param diff The diff which we are to check for conflicts.
 * @param candidates The list of candidates for a conflict. This list only contains Diff from the side opposite to  {@code diff}.
 */
protected void checkFeatureAddConflict(final Comparison comparison,final Diff diff,Iterable<Diff> candidates){
  final Object addedValue;
  final EStructuralFeature feature;
  if (diff instanceof ReferenceChange) {
    addedValue=((ReferenceChange)diff).getValue();
    feature=((ReferenceChange)diff).getReference();
  }
 else {
    addedValue=((AttributeChange)diff).getValue();
    feature=((AttributeChange)diff).getAttribute();
  }
  final Iterable<Diff> refinedCandidates=Iterables.filter(candidates,new Predicate<Diff>(){
    public boolean apply(    Diff input){
      boolean apply=false;
      if (input != null && (input.getKind() == DifferenceKind.ADD && diff.getMatch() == input.getMatch())) {
        if (input instanceof ReferenceChange) {
          apply=((ReferenceChange)input).getReference() == feature;
        }
 else         if (input instanceof AttributeChange) {
          apply=((AttributeChange)input).getAttribute() == feature;
        }
      }
      return apply;
    }
  }
);
  for (  Diff candidate : refinedCandidates) {
    final Object candidateValue;
    if (candidate instanceof ReferenceChange) {
      candidateValue=((ReferenceChange)candidate).getValue();
    }
 else {
      candidateValue=((AttributeChange)candidate).getValue();
    }
    if (feature.isUnique() && helper.matchingValues(comparison,addedValue,candidateValue)) {
      if (matchingIndices(comparison,diff.getMatch(),feature,addedValue,candidateValue)) {
        conflictOn(comparison,diff,candidate,ConflictKind.PSEUDO);
      }
 else {
        conflictOn(comparison,diff,candidate,ConflictKind.REAL);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This will be called from   {@link #checkConflict(Comparison,Diff,Iterable)} in order to detectconflicts on a Diff that is of type "ADD" and which is <b>not</b> a containment reference change. <p> These will conflict with Diffs on the other side on the same reference in the same container, of type ADD an on the same value. </p>
 * @param comparison The originating comparison of those diffs.
 * @param diff The diff which we are to check for conflicts.
 * @param candidates The list of candidates for a conflict. This list only contains Diff from the side opposite to  {@code diff}.
 */
protected void checkFeatureAddConflict(final Comparison comparison,final Diff diff,Iterable<Diff> candidates){
  final Object addedValue;
  final EStructuralFeature feature;
  if (diff instanceof ReferenceChange) {
    addedValue=((ReferenceChange)diff).getValue();
    feature=((ReferenceChange)diff).getReference();
  }
 else   if (diff instanceof AttributeChange) {
    addedValue=((AttributeChange)diff).getValue();
    feature=((AttributeChange)diff).getAttribute();
  }
 else {
    return;
  }
  final Iterable<Diff> refinedCandidates=Iterables.filter(candidates,new Predicate<Diff>(){
    public boolean apply(    Diff input){
      boolean apply=false;
      if (input != null && (input.getKind() == DifferenceKind.ADD && diff.getMatch() == input.getMatch())) {
        if (input instanceof ReferenceChange) {
          apply=((ReferenceChange)input).getReference() == feature;
        }
 else         if (input instanceof AttributeChange) {
          apply=((AttributeChange)input).getAttribute() == feature;
        }
      }
      return apply;
    }
  }
);
  for (  Diff candidate : refinedCandidates) {
    final Object candidateValue;
    if (candidate instanceof ReferenceChange) {
      candidateValue=((ReferenceChange)candidate).getValue();
    }
 else {
      candidateValue=((AttributeChange)candidate).getValue();
    }
    if (feature.isUnique() && helper.matchingValues(comparison,addedValue,candidateValue)) {
      if (matchingIndices(comparison,diff.getMatch(),feature,addedValue,candidateValue)) {
        conflictOn(comparison,diff,candidate,ConflictKind.PSEUDO);
      }
 else {
        conflictOn(comparison,diff,candidate,ConflictKind.REAL);
      }
    }
  }
}