Program: 93722
Project: 93722
Buggy source:
/** 
 * Returns a list containing mappings of the nodes of both given   {@link List}s.
 * @param list1 First of the lists from which we need to map the elements
 * @param list2 Second list to map the elements from.
 * @param window Number of siblings to consider for the matching.
 * @param monitor {@link CompareProgressMonitor Progress monitor} to display while the comparison lasts. Mightbe <code>null</code>, in which case we won't monitor progress.
 * @return A {@link List} containing mappings of the nodes of both given {@link List}s.
 * @throws FactoryException Thrown if the metrics cannot be computed.
 * @throws InterruptedException Thrown if the matching process is interrupted somehow.
 */
private List<Match2Elements> mapLists(List<EObject> list1,List<EObject> list2,int window,CompareProgressMonitor monitor) throws FactoryException, InterruptedException {
  final List<Match2Elements> result=new ArrayList<Match2Elements>();
  int curIndex=0 - window / 2;
  final List<EObject> notFoundList1=new ArrayList<EObject>(list1);
  final List<EObject> notFoundList2=new ArrayList<EObject>(list2);
  final Iterator<EObject> it1=list1.iterator();
  while (it1.hasNext() && notFoundList2.size() > 0) {
    final EObject obj1=it1.next();
    final StringBuilder obj1Key=new StringBuilder();
    obj1Key.append(NameSimilarity.findName(obj1));
    obj1Key.append(obj1.hashCode());
    EObject obj2=matchedByID.get(obj1Key.toString());
    if (obj2 == null) {
      final int end=Math.min(curIndex + window - (list2.size() - notFoundList2.size()),notFoundList2.size());
      final int index=Math.min(Math.max(curIndex - (list2.size() - notFoundList2.size()),0),end);
      obj2=findMostSimilar(obj1,notFoundList2.subList(index,end));
      if (obj2 != null) {
        final EObject obj1Check=findMostSimilar(obj2,notFoundList1);
        if (obj1Check != obj1 && obj1Check != null && isSimilar(obj1Check,obj2)) {
          continue;
        }
      }
    }
    if (notFoundList1.contains(obj1) && notFoundList2.contains(obj2) && isSimilar(obj1,obj2)) {
      final Match2Elements mapping=MatchFactory.eINSTANCE.createMatch2Elements();
      final double metric=absoluteMetric(obj1,obj2);
      mapping.setLeftElement(obj1);
      mapping.setRightElement(obj2);
      mapping.setSimilarity(metric);
      result.add(mapping);
      notFoundList1.remove(obj1);
      notFoundList2.remove(obj2);
    }
    curIndex+=1;
    monitor.worked(1);
    if (monitor.isCanceled())     throw new InterruptedException();
  }
  stillToFindFromModel1.addAll(notFoundList1);
  stillToFindFromModel2.addAll(notFoundList2);
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a list containing mappings of the nodes of both given   {@link List}s.
 * @param list1 First of the lists from which we need to map the elements
 * @param list2 Second list to map the elements from.
 * @param window Number of siblings to consider for the matching.
 * @param monitor {@link CompareProgressMonitor Progress monitor} to display while the comparison lasts. Mightbe <code>null</code>, in which case we won't monitor progress.
 * @return A {@link List} containing mappings of the nodes of both given {@link List}s.
 * @throws FactoryException Thrown if the metrics cannot be computed.
 * @throws InterruptedException Thrown if the matching process is interrupted somehow.
 */
private List<Match2Elements> mapLists(List<EObject> list1,List<EObject> list2,int window,CompareProgressMonitor monitor) throws FactoryException, InterruptedException {
  final List<Match2Elements> result=new ArrayList<Match2Elements>();
  int curIndex=0 - window / 2;
  final List<EObject> notFoundList1=new ArrayList<EObject>(list1);
  final List<EObject> notFoundList2=new ArrayList<EObject>(list2);
  final Iterator<EObject> it1=list1.iterator();
  while (it1.hasNext() && notFoundList2.size() > 0) {
    final EObject obj1=it1.next();
    final StringBuilder obj1Key=new StringBuilder();
    obj1Key.append(NameSimilarity.findName(obj1));
    obj1Key.append(obj1.hashCode());
    EObject obj2=matchedByID.get(obj1Key.toString());
    if (obj2 == null) {
      final int end=Math.min(curIndex + window - (list2.size() - notFoundList2.size()),notFoundList2.size());
      final int index=Math.min(Math.max(curIndex - (list2.size() - notFoundList2.size()),0),end);
      obj2=findMostSimilar(obj1,notFoundList2.subList(index,end));
      if (obj2 != null) {
        final EObject obj1Check=findMostSimilar(obj2,notFoundList1);
        if (obj1Check != obj1 && obj1Check != null && isSimilar(obj1Check,obj2)) {
          continue;
        }
      }
    }
    if (notFoundList1.contains(obj1) && notFoundList2.contains(obj2) && isSimilar(obj1,obj2)) {
      final Match2Elements mapping=MatchFactory.eINSTANCE.createMatch2Elements();
      final double metric=absoluteMetric(obj1,obj2);
      mapping.setLeftElement(obj1);
      mapping.setRightElement(obj2);
      mapping.setSimilarity(metric);
      result.add(mapping);
      notFoundList1.remove(obj1);
      notFoundList2.remove(obj2);
    }
    curIndex+=1;
    monitor.worked(1);
    if (monitor.isCanceled()) {
      throw new InterruptedException();
    }
  }
  stillToFindFromModel1.addAll(notFoundList1);
  stillToFindFromModel2.addAll(notFoundList2);
  return result;
}