Program: 74649
Project: 74649
Buggy source:
private boolean _matchCompositeEntity(CompositeEntity lhsEntity,CompositeEntity hostEntity){
  FastLinkedList<MarkedEntityList> lhsMarkedList=new FastLinkedList<MarkedEntityList>();
  ComponentEntity lhsNextActor=_findFirstChild(lhsEntity,lhsMarkedList,_match.keySet());
  boolean firstEntrance=!_match.containsKey(lhsEntity);
  if (firstEntrance) {
    _match.put(lhsEntity,hostEntity);
  }
  if (lhsNextActor == null) {
    return true;
  }
 else {
    FastLinkedList<Object>.Entry lhsTail=_lhsFrontier.getTail();
    FastLinkedList<Object>.Entry hostTail=_hostFrontier.getTail();
    FastLinkedList<CompositeEntity>.Entry compositeTail=null;
    boolean success=true;
    if (firstEntrance) {
      _visitedLHSCompositeEntities.add(lhsEntity);
      compositeTail=_visitedLHSCompositeEntities.getTail();
      if (lhsEntity instanceof CompositeActor) {
        Director lhsDirector=((CompositeActor)lhsEntity).getDirector();
        if (lhsDirector != null) {
          if (hostEntity instanceof CompositeActor) {
            Director hostDirector=((CompositeActor)hostEntity).getDirector();
            if (hostDirector == null) {
              success=false;
            }
 else {
              success=_matchDirector(lhsDirector,hostDirector);
            }
          }
 else {
            success=false;
          }
        }
      }
    }
    if (success) {
      FastLinkedList<MarkedEntityList> hostMarkedList=new FastLinkedList<MarkedEntityList>();
      ComponentEntity hostNextActor=_findFirstChild(hostEntity,hostMarkedList,_match.values());
      success=false;
      while (!success && hostNextActor != null) {
        _lhsFrontier.add(lhsNextActor);
        _hostFrontier.add(hostNextActor);
        if (_matchEntryList(lhsTail.getNext(),hostTail.getNext())) {
          success=true;
        }
 else {
          _hostFrontier.removeAllAfter(hostTail);
          _lhsFrontier.removeAllAfter(lhsTail);
          if (firstEntrance) {
            _visitedLHSCompositeEntities.removeAllAfter(compositeTail);
          }
          hostNextActor=_findNextChild(hostEntity,hostMarkedList,_match.values());
        }
      }
    }
    if (!success && firstEntrance) {
      _match.remove(lhsEntity);
      compositeTail.remove();
    }
    return success;
  }
}

Fixed version (ground truth):
private boolean _matchCompositeEntity(CompositeEntity lhsEntity,CompositeEntity hostEntity){
  FastLinkedList<MarkedEntityList> lhsMarkedList=new FastLinkedList<MarkedEntityList>();
  ComponentEntity lhsNextActor=_findFirstChild(lhsEntity,lhsMarkedList,_match.keySet());
  boolean success=true;
  boolean firstEntrance=!_match.containsKey(lhsEntity);
  if (firstEntrance) {
    _match.put(lhsEntity,hostEntity);
    if (lhsEntity instanceof CompositeActor && ((CompositeActor)lhsEntity).isOpaque()) {
      Director lhsDirector=((CompositeActor)lhsEntity).getDirector();
      if (hostEntity instanceof CompositeActor && ((CompositeActor)hostEntity).isOpaque()) {
        Director hostDirector=((CompositeActor)hostEntity).getDirector();
        success=_matchDirector(lhsDirector,hostDirector);
      }
 else {
        success=false;
      }
    }
  }
  if (success && lhsNextActor != null) {
    FastLinkedList<Object>.Entry lhsTail=_lhsFrontier.getTail();
    FastLinkedList<Object>.Entry hostTail=_hostFrontier.getTail();
    FastLinkedList<CompositeEntity>.Entry compositeTail=null;
    if (firstEntrance) {
      _visitedLHSCompositeEntities.add(lhsEntity);
      compositeTail=_visitedLHSCompositeEntities.getTail();
    }
    FastLinkedList<MarkedEntityList> hostMarkedList=new FastLinkedList<MarkedEntityList>();
    ComponentEntity hostNextActor=_findFirstChild(hostEntity,hostMarkedList,_match.values());
    success=false;
    while (!success && hostNextActor != null) {
      _lhsFrontier.add(lhsNextActor);
      _hostFrontier.add(hostNextActor);
      if (_matchEntryList(lhsTail.getNext(),hostTail.getNext())) {
        success=true;
      }
 else {
        _hostFrontier.removeAllAfter(hostTail);
        _lhsFrontier.removeAllAfter(lhsTail);
        if (firstEntrance) {
          _visitedLHSCompositeEntities.removeAllAfter(compositeTail);
        }
        hostNextActor=_findNextChild(hostEntity,hostMarkedList,_match.values());
      }
    }
    if (!success && firstEntrance) {
      compositeTail.remove();
    }
  }
  if (!success && firstEntrance) {
    _match.remove(lhsEntity);
  }
  return success;
}