Program: 74377
Project: 74377
Buggy source:
private boolean _matchCompositeEntity(CompositeEntity patternEntity,CompositeEntity hostEntity){
  if (patternEntity instanceof GTEntity && !((GTEntity)patternEntity).match(hostEntity)) {
    return false;
  }
  int matchSize=_match.size();
  ParameterIterator configIterator;
  try {
    configIterator=new ParameterIterator(patternEntity);
  }
 catch (  IllegalActionException e) {
    return false;
  }
  boolean success=false;
  while (!success && configIterator.next()) {
    success=true;
    ObjectList patternList=new ObjectList();
    ObjectList hostList=new ObjectList();
    _match.put(patternEntity,hostEntity);
    Director patternDirector=null;
    Director hostDirector=null;
    if (patternEntity instanceof CompositeActor && ((CompositeActor)patternEntity).isOpaque()) {
      patternDirector=((CompositeActor)patternEntity).getDirector();
      if (_ignoreObject(patternDirector)) {
        patternDirector=null;
      }
    }
    if (hostEntity instanceof CompositeActor && ((CompositeActor)hostEntity).isOpaque()) {
      hostDirector=((CompositeActor)hostEntity).getDirector();
      if (_ignoreObject(hostDirector)) {
        hostDirector=null;
      }
    }
    if (patternDirector != null && hostDirector != null) {
      success=_shallowMatchDirector(patternDirector,hostDirector);
    }
 else     if (patternDirector != null) {
      success=false;
    }
    if (success) {
      IndexedLists patternMarkedList=new IndexedLists();
      NamedObj patternNextChild=findFirstChild(patternEntity,patternMarkedList,_match.keySet());
      while (patternNextChild != null) {
        patternList.add(patternNextChild);
        patternNextChild=findNextChild(patternEntity,patternMarkedList,_match.keySet());
      }
      IndexedLists hostMarkedList=new IndexedLists();
      NamedObj hostNextObject=findFirstChild(hostEntity,hostMarkedList,_match.values());
      while (hostNextObject != null) {
        hostList.add(hostNextObject);
        hostNextObject=findNextChild(hostEntity,hostMarkedList,_match.values());
      }
    }
    if (success) {
      patternList.addAll((Collection<?>)patternEntity.portList());
      hostList.addAll((Collection<?>)hostEntity.portList());
    }
    success=success && _matchObject(patternList,hostList);
    if (!success) {
      _match.retain(matchSize);
    }
  }
  return success;
}

Fixed version (ground truth):
private boolean _matchCompositeEntity(CompositeEntity patternEntity,CompositeEntity hostEntity){
  if (patternEntity instanceof GTEntity && !((GTEntity)patternEntity).match(hostEntity)) {
    return false;
  }
  int matchSize=_match.size();
  ParameterIterator configIterator;
  try {
    configIterator=new ParameterIterator(patternEntity);
  }
 catch (  IllegalActionException e) {
    return false;
  }
  boolean success=false;
  while (!success && configIterator.next()) {
    success=true;
    ObjectList patternList=new ObjectList();
    ObjectList hostList=new ObjectList();
    _match.put(patternEntity,hostEntity);
    Director patternDirector=null;
    Director hostDirector=null;
    if (patternEntity instanceof CompositeActor && ((CompositeActor)patternEntity).isOpaque()) {
      patternDirector=((CompositeActor)patternEntity).getDirector();
      if (_ignoreObject(patternDirector)) {
        patternDirector=null;
      }
    }
    if (hostEntity instanceof CompositeActor && ((CompositeActor)hostEntity).isOpaque()) {
      hostDirector=((CompositeActor)hostEntity).getDirector();
      if (_ignoreObject(hostDirector)) {
        hostDirector=null;
      }
    }
    if (patternDirector != null && hostDirector != null) {
      success=_shallowMatchDirector(patternDirector,hostDirector);
    }
 else     if (patternDirector != null) {
      success=false;
    }
    if (success) {
      IndexedLists patternMarkedList=new IndexedLists();
      NamedObj patternNextChild=findFirstChild(patternEntity,patternMarkedList,_match.keySet());
      while (patternNextChild != null) {
        patternList.add(patternNextChild);
        patternNextChild=findNextChild(patternEntity,patternMarkedList,_match.keySet());
      }
      IndexedLists hostMarkedList=new IndexedLists();
      NamedObj hostNextObject=findFirstChild(hostEntity,hostMarkedList,_match.values());
      while (hostNextObject != null) {
        hostList.add(hostNextObject);
        hostNextObject=findNextChild(hostEntity,hostMarkedList,_match.values());
      }
    }
    if (success) {
      for (      Object portObject : patternEntity.portList()) {
        if (!_ignoreObject(portObject)) {
          patternList.add(portObject);
        }
      }
      for (      Object portObject : hostEntity.portList()) {
        if (!_ignoreObject(portObject)) {
          hostList.add(portObject);
        }
      }
    }
    success=success && _matchObject(patternList,hostList);
    if (!success) {
      _match.retain(matchSize);
    }
  }
  return success;
}