nus-yam/ex-repair huggingface dataset:
Program: 74634
Project: 74634
Buggy source:
/** 
 * Preinitialize the model.  This calls the preinitialize() method of the container, followed by the resolveTypes() methods.  Set the Manager's state to PREINITIALIZING.  Note that this method may be invoked without actually running the method, but the calling code must make sure that the Manager's state is reset to IDLE.  This method is read synchronized on the workspace.
 * @exception KernelException If the model throws it.
 * @exception IllegalActionException If the model is already running, orif there is no container.
 */
public synchronized void preinitializeAndResolveTypes() throws KernelException {
  try {
    _workspace.getReadAccess();
    if (_state != IDLE) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
    if (_container == null) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
    _setState(PREINITIALIZING);
    _exitAfterWrapup=false;
    _pauseRequested=false;
    _typesResolved=false;
    _iterationCount=0;
    _resumeNotifyWaiting=false;
    _container.preinitialize();
    executeChangeRequests();
    resolveTypes();
    _typesResolved=true;
  }
  finally {
    if (_nameToAnalysis != null) {
      _nameToAnalysis.clear();
      _nameToAnalysis=null;
    }
    _workspace.doneReading();
  }
}

Fixed version (ground truth):
/** 
 * Preinitialize the model.  This calls the preinitialize() method of the container, followed by the resolveTypes() methods.  Set the Manager's state to PREINITIALIZING.  Note that this method may be invoked without actually running the method, but the calling code must make sure that the Manager's state is reset to IDLE.  This method is read synchronized on the workspace.
 * @exception KernelException If the model throws it.
 * @exception IllegalActionException If the model is already running, orif there is no container.
 */
public synchronized void preinitializeAndResolveTypes() throws KernelException {
  try {
    _workspace.getReadAccess();
    if (_state != IDLE) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
    if (_container == null) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
    _setState(PREINITIALIZING);
    _exitAfterWrapup=false;
    _pauseRequested=false;
    _typesResolved=false;
    _iterationCount=0;
    _resumeNotifyWaiting=false;
    if (_nameToAnalysis != null) {
      _nameToAnalysis.clear();
      _nameToAnalysis=null;
    }
    _container.preinitialize();
    executeChangeRequests();
    resolveTypes();
    _typesResolved=true;
  }
  finally {
    if (_nameToAnalysis != null) {
      _nameToAnalysis.clear();
      _nameToAnalysis=null;
    }
    _workspace.doneReading();
  }
}
Program: 74635
Project: 74635
Buggy source:
protected GraphController _getGraphController(){
  if (_controller == null) {
    _controller=null;
  }
  return _controller;
}

Fixed version (ground truth):
protected GraphController _getGraphController(){
  if (_tabbedPane == null) {
    return _controller;
  }
 else {
    int index=_tabbedPane.getSelectedIndex();
    return _graphs.get(index).getGraphPane().getGraphController();
  }
}
Program: 74636
Project: 74636
Buggy source:
protected CompositeActorMatcher _getCurrentMatcher(){
  ActorGraphModel graphModel=(ActorGraphModel)_controller.getGraphModel();
  CompositeActorMatcher matcher=(CompositeActorMatcher)graphModel.getPtolemyModel();
  if (hasTabs()) {
    int index=_tabbedPane.getSelectedIndex();
    NamedObj parent=matcher.getContainer();
    while (!(parent instanceof SingleRuleTransformer)) {
      parent=parent.getContainer();
    }
    List<?> entityList=((SingleRuleTransformer)parent).entityList(CompositeActorMatcher.class);
    return (CompositeActorMatcher)entityList.get(index);
  }
 else {
    return matcher;
  }
}

Fixed version (ground truth):
protected CompositeEntity _getCurrentMatcher(){
  ActorGraphModel graphModel=(ActorGraphModel)_controller.getGraphModel();
  CompositeEntity model=(CompositeEntity)graphModel.getPtolemyModel();
  if (hasTabs()) {
    int index=_tabbedPane.getSelectedIndex();
    NamedObj parent=model.getContainer();
    while (!(parent instanceof SingleRuleTransformer)) {
      parent=parent.getContainer();
    }
    List<?> entityList=((SingleRuleTransformer)parent).entityList(CompositeActorMatcher.class);
    return (CompositeActorMatcher)entityList.get(index);
  }
 else {
    return model;
  }
}
Program: 74637
Project: 74637
Buggy source:
public void highlightMatchedObjects(){
  if (_result != null) {
    CompositeActorMatcher matcher=_getCurrentMatcher();
    Set<?> matchedHostObjects=_result.values();
    for (    Object child : matcher.entityList(AtomicActor.class)) {
      if (matchedHostObjects.contains(child)) {
        highlightMatchedObject((NamedObj)child);
      }
    }
  }
}

Fixed version (ground truth):
public void highlightMatchedObjects(){
  if (_result != null) {
    CompositeEntity matcher=_getCurrentMatcher();
    Set<?> matchedHostObjects=_result.values();
    for (    Object child : matcher.entityList(AtomicActor.class)) {
      if (matchedHostObjects.contains(child)) {
        highlightMatchedObject((NamedObj)child);
      }
    }
  }
}
Program: 74638
Project: 74638
Buggy source:
public static void main(String[] args) throws Exception {
  if (!(args.length == 2 || (args.length == 3 && args[0].equalsIgnoreCase("String_Node_Str")))) {
    System.err.println("String_Node_Str" + RecursiveGraphMatcher.class.getName() + "String_Node_Str");
    System.exit(1);
  }
  final boolean all=args.length == 3 && args[0].equalsIgnoreCase("String_Node_Str");
  String lhsXMLFile=all ? args[1] : args[0];
  String hostXMLFile=all ? args[2] : args[1];
  MatchCallback matchCallback=new MatchCallback(){
    public boolean foundMatch(    RecursiveGraphMatcher matcher){
      MatchResult match=matcher.getMatchResult();
      System.out.println("String_Node_Str" + ++count + "String_Node_Str");
      _printMatch(match);
      return !all;
    }
    private int count=0;
  }
;
  match(lhsXMLFile,hostXMLFile,matchCallback);
}

Fixed version (ground truth):
/** 
 * Match the given model file with a rule file. This main method takes a parameter array of length 2 or 3. If the array has 2 elements, the first string is the rule file name, and the second is the model file name. An arbitrary match is printed to the console. If it has 3 elements, the first string should be "<tt>-A</tt>", the second string is the rule file name, and the third is the model file name. All the matches are printed to to console in that case.
 * @param args The parameter array.
 * @exception Exception If the rule file or the model file cannot be read.
 */
public static void main(String[] args) throws Exception {
  if (!(args.length == 2 || (args.length == 3 && args[0].equalsIgnoreCase("String_Node_Str")))) {
    System.err.println("String_Node_Str" + RecursiveGraphMatcher.class.getName() + "String_Node_Str");
    System.exit(1);
  }
  final boolean all=args.length == 3 && args[0].equalsIgnoreCase("String_Node_Str");
  String lhsXMLFile=all ? args[1] : args[0];
  String hostXMLFile=all ? args[2] : args[1];
  MatchCallback matchCallback=new MatchCallback(){
    public boolean foundMatch(    RecursiveGraphMatcher matcher){
      MatchResult match=matcher.getMatchResult();
      System.out.println("String_Node_Str" + ++count + "String_Node_Str");
      _printMatch(match);
      return !all;
    }
    private int count=0;
  }
;
  match(lhsXMLFile,hostXMLFile,matchCallback);
}
Program: 74639
Project: 74639
Buggy source:
public void setMatchCallback(MatchCallback callback){
  _callback=callback;
}

Fixed version (ground truth):
/** 
 * Set the callback to be invoked by future calls to   {@link #match(CompositeActorMatcher,NamedObj)}.
 * @param callback The callback.
 */
public void setMatchCallback(MatchCallback callback){
  _callback=callback;
}
Program: 74640
Project: 74640
Buggy source:
public boolean isSuccessful(){
  return _success;
}

Fixed version (ground truth):
/** 
 * Return whether the last matching was successful. The success of a match does not only mean that at least one match was found, but it also means that the callback (an object of   {@link MatchCallback}) returned <tt>true</tt> when it was invoked with the last match result.
 * @return Whether the last matching was successful.
 */
public boolean isSuccessful(){
  return _success;
}
Program: 74641
Project: 74641
Buggy source:
/** 
 * Get the last matching result as an unmodifiable map.
 * @return The last matching result.
 */
public MatchResult getMatchResult(){
  return _match;
}

Fixed version (ground truth):
/** 
 * Get the latest matching result. This result is not made unmodifiable, but the user is not supposed to modify it. During the matching process, if a callback routine (an object of   {@link MatchCallback}) is invoked, it can call this method to retrieve the new match result. However, the returned object may be changed by future matching. To maintain a copy of this result,   {@link MatchResult#clone()} may be called that returns aclone of it.
 * @return The latest matching result.
 */
public MatchResult getMatchResult(){
  return _match;
}
Program: 74643
Project: 74643
Buggy source:
public static RecursiveGraphMatcher match(String lhsXMLFile,String hostXMLFile,MatchCallback callback) throws MalformedURLException, Exception {
  MoMLParser parser=new MoMLParser();
  SingleRuleTransformer rule=(SingleRuleTransformer)parser.parse(null,new File(lhsXMLFile).toURI().toURL());
  parser.reset();
  NamedObj host=parser.parse(null,new File(hostXMLFile).toURI().toURL());
  RecursiveGraphMatcher matcher=new RecursiveGraphMatcher();
  if (callback != null) {
    matcher.setMatchCallback(callback);
  }
  matcher.match(rule.getLeftHandSide(),host);
  return matcher;
}

Fixed version (ground truth):
/** 
 * Match the host model stored in the file with name <tt>hostXMLFile</tt> with the rule stored in the file with name <tt>lhsXMLFile</tt>, and invoke <tt>callback</tt>'s   {@link MatchCallback#foundMatch(RecursiveGraphMatcher)} method whenever a matchis found. If the callback returns <tt>true</tt>, the match will terminate and no more matches will be reported; otherwise, the match process continues, and if one more match is found, the callback will be invoked again.
 * @param lhsXMLFile The name of the file in which the rule is stored.
 * @param hostXMLFile The name of the file in which the model to be matchedis stored.
 * @param callback The callback to be invoked when matches are found.
 * @return A matcher object with the last match result stored in it. If nomatch is found, or though matches are found, the callback returns <tt>false</tt> for all the matches, then  {@link #isSuccessful()} of thematcher object returns <tt>false</tt>, and  {@link #getMatchResult()}returns an empty match.
 * @exception Exception If the rule file or the model file cannot be read.
 */
public static RecursiveGraphMatcher match(String lhsXMLFile,String hostXMLFile,MatchCallback callback) throws Exception {
  MoMLParser parser=new MoMLParser();
  SingleRuleTransformer rule=(SingleRuleTransformer)parser.parse(null,new File(lhsXMLFile).toURI().toURL());
  parser.reset();
  NamedObj host=parser.parse(null,new File(hostXMLFile).toURI().toURL());
  RecursiveGraphMatcher matcher=new RecursiveGraphMatcher();
  if (callback != null) {
    matcher.setMatchCallback(callback);
  }
  matcher.match(rule.getLeftHandSide(),host);
  return matcher;
}
Program: 74644
Project: 74644
Buggy source:
private boolean _matchDirector(Director lhsDirector,Director hostDirector){
  int matchSize=_match.size();
  _match.put(lhsDirector,hostDirector);
  boolean success=lhsDirector.getClass().equals(hostDirector.getClass());
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}

Fixed version (ground truth):
private boolean _matchDirector(Director lhsDirector,Director hostDirector){
  if (lhsDirector == null && hostDirector == null) {
    return true;
  }
 else   if (lhsDirector == null || hostDirector == null) {
    return false;
  }
  int matchSize=_match.size();
  _match.put(lhsDirector,hostDirector);
  boolean success=lhsDirector.getClass().equals(hostDirector.getClass());
  if (!success) {
    _match.retain(matchSize);
  }
  return success;
}
Program: 74646
Project: 74646
Buggy source:
/** 
 * Generate the code for the firing of actors controlled by this director.  It generates code for making preemptive transition, checking if a transition is taken, firing refinements and making non-preemptive transition.
 * @return The generated fire code.
 * @exception IllegalActionException If the helper associated withan actor throws it while generating fire code for the actor.
 */
public String generateFireCode() throws IllegalActionException {
  ptolemy.domains.fsm.kernel.FSMActor controller=((ptolemy.domains.fsm.kernel.FSMDirector)getComponent()).getController();
  FSMActor controllerHelper=(FSMActor)_getHelper(controller);
  StringBuffer code=new StringBuffer();
  code.append(_eol + "String_Node_Str" + _eol+ _eol);
  controllerHelper.generateTransitionCode(code,new TransitionRetriever(){
    public Iterator retrieveTransitions(    State state){
      return state.preemptiveTransitionList().iterator();
    }
  }
);
  code.append(_eol);
  code.append("String_Node_Str" + controllerHelper.processCode("String_Node_Str") + "String_Node_Str"+ _eol);
  _generateRefinementCode(code);
  code.append(_eol + "String_Node_Str" + _eol+ _eol);
  controllerHelper.generateTransitionCode(code,new TransitionRetriever(){
    public Iterator retrieveTransitions(    State state){
      return state.nonpreemptiveTransitionList().iterator();
    }
  }
);
  code.append("String_Node_Str");
  return code.toString();
}

Fixed version (ground truth):
/** 
 * Generate the code for the firing of actors controlled by this director.  It generates code for making preemptive transition, checking if a transition is taken, firing refinements and making non-preemptive transition.
 * @return The generated fire code.
 * @exception IllegalActionException If the helper associated withan actor throws it while generating fire code for the actor.
 */
public String generateFireCode() throws IllegalActionException {
  ptolemy.domains.fsm.kernel.FSMActor controller=((ptolemy.domains.fsm.kernel.FSMDirector)getComponent()).getController();
  FSMActor controllerHelper=(FSMActor)_getHelper(controller);
  StringBuffer code=new StringBuffer();
  code.append(_eol + "String_Node_Str" + _eol+ _eol);
  controllerHelper.generateTransitionCode(code,new TransitionRetriever(){
    public Iterator retrieveTransitions(    State state){
      return state.preemptiveTransitionList().iterator();
    }
  }
);
  code.append(_eol);
  code.append("String_Node_Str" + controllerHelper.processCode("String_Node_Str") + "String_Node_Str"+ _eol);
  _generateRefinementCode(code);
  code.append(_eol + "String_Node_Str" + _eol+ _eol);
  controllerHelper.generateTransitionCode(code,new TransitionRetriever(){
    public Iterator retrieveTransitions(    State state){
      return state.nonpreemptiveTransitionList().iterator();
    }
  }
);
  code.append("String_Node_Str" + _eol);
  return code.toString();
}
Program: 74648
Project: 74648
Buggy source:
/** 
 * Generate the fire code. In this base class, add the name of the associated component in the comment. Subclasses may extend this method to generate the fire code of the associated component.
 * @return The generated code.
 * @exception IllegalActionException Not thrown in this base class.
 */
public String generateFireCode() throws IllegalActionException {
  _codeStream.clear();
  String composite=(getComponent() instanceof CompositeActor) ? "String_Node_Str" : "String_Node_Str";
  _codeStream.append(_eol + CodeStream.indent(_codeGenerator.comment("String_Node_Str" + composite + getComponent().getName())));
  _codeStream.appendCodeBlock(_defaultBlocks[2],true);
  return processCode(_codeStream.toString());
}

Fixed version (ground truth):
/** 
 * Generate the fire code. In this base class, add the name of the associated component in the comment. Subclasses may extend this method to generate the fire code of the associated component.
 * @return The generated code.
 * @exception IllegalActionException Not thrown in this base class.
 */
public String generateFireCode() throws IllegalActionException {
  _codeStream.clear();
  String composite=(getComponent() instanceof CompositeActor) ? "String_Node_Str" : "String_Node_Str";
  _codeStream.append(_eol + CodeStream.indent(_codeGenerator.comment("String_Node_Str" + composite + getComponent().getName())));
  _codeStream.appendCodeBlock(_defaultBlocks[2],true);
  try {
    _copyFilesToCodeDirectory();
  }
 catch (  IOException ex) {
    throw new IllegalActionException(this,ex,"String_Node_Str");
  }
  return processCode(_codeStream.toString());
}
Program: 74650
Project: 74650
Buggy source:
/** 
 * Test whether the composite entity starts a new level of composition. Return <tt>true</tt> if the composite entity is the top-level composite entity of the match operation, or the composite entity has a director defined in it.
 * @param container The composite entity to be tested.
 * @return <tt>true</tt> if the composite entity starts a new level;<tt>false</tt> otherwise.
 */
private boolean _isNewLevel(CompositeEntity container){
  return container instanceof CompositeActor && ((CompositeActor)container).getDirector() != null;
}

Fixed version (ground truth):
/** 
 * Test whether the composite entity starts a new level of composition. Return <tt>true</tt> if the composite entity is the top-level composite entity of the match operation, or the composite entity has a director defined in it.
 * @param container The composite entity to be tested.
 * @return <tt>true</tt> if the composite entity starts a new level;<tt>false</tt> otherwise.
 */
private boolean _isNewLevel(CompositeEntity container){
  return container instanceof CompositeActor && ((CompositeActor)container).isOpaque();
}
Program: 74651
Project: 74651
Buggy source:
/** 
 * Clone the actor into the specified workspace. This calls the base class and then sets the attribute public members to refer to the attributes of the new actor.
 * @param workspace The workspace for the new actor.
 * @return A new FSMActor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  FSMActor newObject=(FSMActor)super.clone(workspace);
  newObject._inputPortsVersion=-1;
  newObject._outputPortsVersion=-1;
  newObject._connectionMapsVersion=-1;
  newObject._connectionMaps=null;
  newObject._inputTokenMap=new HashMap();
  newObject._identifierToPort=new HashMap();
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace. This calls the base class and then sets the attribute public members to refer to the attributes of the new actor.
 * @param workspace The workspace for the new actor.
 * @return A new FSMActor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  FSMActor newObject=(FSMActor)super.clone(workspace);
  newObject._inputPortsVersion=-1;
  newObject._outputPortsVersion=-1;
  newObject._connectionMapsVersion=-1;
  newObject._connectionMaps=null;
  newObject._inputTokenMap=new HashMap();
  newObject._identifierToPort=new HashMap();
  if (_initialState != null) {
    newObject._initialState=(State)newObject.getEntity(_initialState.getName());
  }
  return newObject;
}
Program: 74652
Project: 74652
Buggy source:
/** 
 * Match a list of LHS entries with a list of host entries. All LHS entries must be matched with some or all of the host entries.
 * @param lhsEntry The start of the LHS entries.
 * @param hostEntry The start of the host entries.
 * @return <tt>true</tt> is the match is successful; <tt>false</tt>otherwise.
 */
private boolean _matchEntryList(FastLinkedList<NamedObj>.Entry lhsEntry,FastLinkedList<NamedObj>.Entry hostEntry){
  if (lhsEntry == null) {
    return true;
  }
 else {
    NamedObj lhsObject=lhsEntry.getValue();
    while (hostEntry != null) {
      if (_matchNamedObj(lhsObject,hostEntry.getValue())) {
        return true;
      }
 else {
        hostEntry=hostEntry.getNext();
      }
    }
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Match a list of LHS entries with a list of host entries. All LHS entries must be matched with some or all of the host entries.
 * @param lhsEntry The start of the LHS entries.
 * @param hostEntry The start of the host entries.
 * @return <tt>true</tt> is the match is successful; <tt>false</tt>otherwise.
 */
private boolean _matchEntryList(FastLinkedList<NamedObj>.Entry lhsEntry,FastLinkedList<NamedObj>.Entry hostEntry){
  if (lhsEntry == null) {
    return true;
  }
 else {
    NamedObj lhsObject=lhsEntry.getValue();
    while (hostEntry != null) {
      NamedObj hostObject=hostEntry.getValue();
      if (_matchNamedObj(lhsObject,hostObject)) {
        return true;
      }
 else {
        hostEntry=hostEntry.getNext();
      }
    }
    return false;
  }
}
Program: 74653
Project: 74653
Buggy source:
private boolean _matchRelation(Relation lhsRelation,Relation hostRelation){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsRelation,hostRelation);
  for (  Object portObject : lhsRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsKey(container)) {
      _lhsFrontier.add(container);
    }
  }
  for (  Object portObject : hostRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsValue(container)) {
      _hostFrontier.add(container);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsRelation);
    _hostFrontier.removeAllAfter(hostTail);
    _lhsFrontier.removeAllAfter(lhsTail);
    return false;
  }
}

Fixed version (ground truth):
private boolean _matchRelation(Relation lhsRelation,Relation hostRelation){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsRelation,hostRelation);
  for (  Port port : _findLinkedPorts(lhsRelation,true)) {
    _lhsFrontier.add(port);
  }
  for (  Port port : _findLinkedPorts(hostRelation,false)) {
    _hostFrontier.add(port);
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsRelation);
    _hostFrontier.removeAllAfter(hostTail);
    _lhsFrontier.removeAllAfter(lhsTail);
    return false;
  }
}
Program: 74654
Project: 74654
Buggy source:
private boolean _matchPort(Port lhsPort,Port hostPort){
  if (!_shallowMatchPort(lhsPort,hostPort)) {
    return false;
  }
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsPort,hostPort);
  for (  Object relationObject : lhsPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsKey(relation)) {
      _lhsFrontier.add(relation);
    }
  }
  for (  Object relationObject : hostPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsValue(relation)) {
      _hostFrontier.add(relation);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsPort);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}

Fixed version (ground truth):
private boolean _matchPort(Port lhsPort,Port hostPort){
  if (!_shallowMatchPort(lhsPort,hostPort)) {
    return false;
  }
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsPort,hostPort);
  NamedObj lhsContainer=lhsPort.getContainer();
  if (!_match.containsKey(lhsContainer)) {
    _lhsFrontier.add(lhsContainer);
  }
  NamedObj hostContainer=hostPort.getContainer();
  if (!_match.containsValue(hostContainer)) {
    _hostFrontier.add(hostContainer);
  }
  for (  Object relationObject : lhsPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsKey(relation)) {
      _lhsFrontier.add(relation);
    }
  }
  for (  Object relationObject : hostPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsValue(relation)) {
      _hostFrontier.add(relation);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsPort);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}
Program: 74655
Project: 74655
Buggy source:
/** 
 * React to a change in an attribute. If the changed attribute is the <i>refinementName</i> attribute, record the change but do not check whether there is a TypedActor with the specified name and having the same container as the FSMActor containing this state.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If thrown by the superclassattributeChanged() method.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == refinementName) {
    _refinementVersion=-1;
  }
 else   if (attribute == isInitialState) {
    NamedObj container=getContainer();
    if (container instanceof FSMActor) {
      if (((BooleanToken)isInitialState.getToken()).booleanValue()) {
        if (((FSMActor)container)._initialState != null && ((FSMActor)container)._initialState != this) {
          ((FSMActor)container)._initialState.isInitialState.setToken("String_Node_Str");
        }
        ((FSMActor)container)._initialState=this;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * React to a change in an attribute. If the changed attribute is the <i>refinementName</i> attribute, record the change but do not check whether there is a TypedActor with the specified name and having the same container as the FSMActor containing this state.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException If thrown by the superclassattributeChanged() method.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == refinementName) {
    _refinementVersion=-1;
  }
 else   if (attribute == isInitialState) {
    NamedObj container=getContainer();
    if (container instanceof FSMActor) {
      if (((BooleanToken)isInitialState.getToken()).booleanValue()) {
        if (((FSMActor)container)._initialState != null && ((FSMActor)container)._initialState != this) {
          ((FSMActor)container)._initialState.isInitialState.setToken("String_Node_Str");
        }
        ((FSMActor)container)._initialState=this;
        String name=((FSMActor)container).initialStateName.getExpression();
        if (!name.equals("String_Node_Str")) {
          ((FSMActor)container).initialStateName.setExpression("String_Node_Str");
        }
      }
    }
  }
}
Program: 74656
Project: 74656
Buggy source:
private boolean _tryToMatchPort(Port lhsPort,Port hostPort){
  if (!_checkPortMatch(lhsPort,hostPort)) {
    return false;
  }
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsPort,hostPort);
  for (  Object relationObject : lhsPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsKey(relation)) {
      _lhsFrontier.add(relation);
    }
  }
  for (  Object relationObject : hostPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsValue(relation)) {
      _hostFrontier.add(relation);
    }
  }
  if (_matchLoop(lhsTail.getNext(),hostTail.getNext())) {
    return true;
  }
 else {
    _match.remove(lhsPort);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}

Fixed version (ground truth):
private boolean _tryToMatchPort(Port lhsPort,Port hostPort){
  if (!_checkPortMatch(lhsPort,hostPort)) {
    return false;
  }
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsPort,hostPort);
  for (  Object relationObject : lhsPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsKey(relation)) {
      _lhsFrontier.add(relation);
    }
  }
  for (  Object relationObject : hostPort.linkedRelationList()) {
    Relation relation=(Relation)relationObject;
    if (!_match.containsValue(relation)) {
      _hostFrontier.add(relation);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsPort);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}
Program: 74657
Project: 74657
Buggy source:
public void match(CompositeActorMatcher lhsGraph,NamedObj hostGraph) throws SubgraphMatchingException {
  _match=new HashMap<NamedObj,NamedObj>();
  _lhsFrontier=new FastLinkedList<NamedObj>();
  _hostFrontier=new FastLinkedList<NamedObj>();
  _lhsFrontier.add(lhsGraph);
  _hostFrontier.add(hostGraph);
  if (_match(_lhsFrontier.getHead(),_hostFrontier.getHead())) {
    for (    NamedObj lhsObject : _match.keySet()) {
      System.out.println(lhsObject.getName() + "String_Node_Str" + _match.get(lhsObject).getName());
    }
  }
}

Fixed version (ground truth):
public void match(CompositeActorMatcher lhsGraph,NamedObj hostGraph) throws SubgraphMatchingException {
  _match=new FastHashMap<NamedObj,NamedObj>();
  _lhsFrontier=new FastLinkedList<NamedObj>();
  _hostFrontier=new FastLinkedList<NamedObj>();
  _lhsFrontier.add(lhsGraph);
  _hostFrontier.add(hostGraph);
  if (_match(_lhsFrontier.getHead(),_hostFrontier.getHead())) {
    for (    NamedObj lhsObject : _match.keySet()) {
      System.out.println(lhsObject.getName() + "String_Node_Str" + _match.get(lhsObject).getName());
    }
  }
}
Program: 74658
Project: 74658
Buggy source:
private boolean _tryToMatchAtomicActor(AtomicActor lhsActor,AtomicActor hostActor){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsActor,hostActor);
  for (  Object portObject : lhsActor.portList()) {
    Port port=(Port)portObject;
    if (!_match.containsKey(port)) {
      _lhsFrontier.add(port);
    }
  }
  for (  Object portObject : hostActor.portList()) {
    Port port=(Port)portObject;
    if (!_match.containsValue(port)) {
      _hostFrontier.add(port);
    }
  }
  if (_matchLoop(lhsTail.getNext(),hostTail.getNext())) {
    return true;
  }
 else {
    _match.remove(lhsActor);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}

Fixed version (ground truth):
private boolean _tryToMatchAtomicActor(AtomicActor lhsActor,AtomicActor hostActor){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsActor,hostActor);
  for (  Object portObject : lhsActor.portList()) {
    Port port=(Port)portObject;
    if (!_match.containsKey(port)) {
      _lhsFrontier.add(port);
    }
  }
  for (  Object portObject : hostActor.portList()) {
    Port port=(Port)portObject;
    if (!_match.containsValue(port)) {
      _hostFrontier.add(port);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsActor);
    _lhsFrontier.removeAllAfter(lhsTail);
    _hostFrontier.removeAllAfter(hostTail);
    return false;
  }
}
Program: 74659
Project: 74659
Buggy source:
private boolean _tryToMatchRelation(Relation lhsRelation,Relation hostRelation){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsRelation,hostRelation);
  for (  Object portObject : lhsRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsKey(container)) {
      _lhsFrontier.add(container);
    }
  }
  for (  Object portObject : hostRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsValue(container)) {
      _hostFrontier.add(container);
    }
  }
  if (_matchLoop(lhsTail.getNext(),hostTail.getNext())) {
    return true;
  }
 else {
    _match.remove(lhsRelation);
    _hostFrontier.removeAllAfter(hostTail);
    _lhsFrontier.removeAllAfter(lhsTail);
    return false;
  }
}

Fixed version (ground truth):
private boolean _tryToMatchRelation(Relation lhsRelation,Relation hostRelation){
  FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
  FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
  _match.put(lhsRelation,hostRelation);
  for (  Object portObject : lhsRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsKey(container)) {
      _lhsFrontier.add(container);
    }
  }
  for (  Object portObject : hostRelation.linkedPortList()) {
    Port port=(Port)portObject;
    NamedObj container=port.getContainer();
    if (!_match.containsValue(container)) {
      _hostFrontier.add(container);
    }
  }
  if (_matchLoop(lhsTail,hostTail)) {
    return true;
  }
 else {
    _match.remove(lhsRelation);
    _hostFrontier.removeAllAfter(hostTail);
    _lhsFrontier.removeAllAfter(lhsTail);
    return false;
  }
}
Program: 74660
Project: 74660
Buggy source:
private boolean _matchLoop(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  if (lhsStart == null) {
    return true;
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsEntry=lhsStart;
    boolean nestedMatch=false;
    while (lhsEntry != null) {
      nestedMatch=true;
      if (!_match(lhsEntry,hostStart)) {
        return false;
      }
      lhsEntry=lhsEntry.getNext();
    }
    if (nestedMatch) {
      return true;
    }
 else {
      return _checkDisconnectedComponents(lhsStart,lhsEntry);
    }
  }
}

Fixed version (ground truth):
private boolean _matchLoop(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsChildStart=lhsStart.getNext();
  FastLinkedList<NamedObj>.Entry hostChildStart=hostStart.getNext();
  if (lhsChildStart == null) {
    return _checkDisconnectedComponents(lhsStart,hostStart);
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsEntry=lhsChildStart;
    boolean nestedMatch=false;
    while (lhsEntry != null) {
      nestedMatch=true;
      if (!_match(lhsEntry,hostChildStart)) {
        return false;
      }
      lhsEntry=lhsEntry.getNext();
    }
    if (nestedMatch) {
      return true;
    }
 else {
      return _checkDisconnectedComponents(lhsChildStart,lhsEntry);
    }
  }
}
Program: 74661
Project: 74661
Buggy source:
private boolean _checkDisconnectedComponents(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsEntry=lhsStart;
  while (lhsEntry != null) {
    NamedObj lhsObject=lhsEntry.getValue();
    if (lhsObject instanceof CompositeEntity) {
      CompositeEntity lhsEntity=(CompositeEntity)lhsObject;
      int size;
      do {
        size=_match.size();
        if (!_tryToMatchCompositeEntity(lhsEntity,(CompositeEntity)_match.get(lhsEntity))) {
          return false;
        }
      }
 while (_match.size() > size);
    }
    lhsEntry=lhsEntry.getPrevious();
  }
  return true;
}

Fixed version (ground truth):
private boolean _checkDisconnectedComponents(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsEntry=lhsStart;
  while (lhsEntry != null) {
    NamedObj lhsObject=lhsEntry.getValue();
    if (lhsObject instanceof CompositeEntity) {
      CompositeEntity lhsEntity=(CompositeEntity)lhsObject;
      int size;
      do {
        size=_match.size();
        if (_match.containsKey(lhsEntity) && !_tryToMatchCompositeEntity(lhsEntity,(CompositeEntity)_match.get(lhsEntity))) {
          return false;
        }
      }
 while (_match.size() > size);
    }
    lhsEntry=lhsEntry.getPrevious();
  }
  return true;
}
Program: 74662
Project: 74662
Buggy source:
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == ruleList) {
    try {
      _workspace.getWriteAccess();
      removeAllPorts();
      for (      Rule rule : ruleList.getRuleList()) {
        if (rule instanceof PortRule) {
          PortRule portRule=(PortRule)rule;
          TypedIOPort port=new TypedIOPort(this,portRule.getPortName(),portRule.isInput(),portRule.isOutput());
          port.setPersistent(false);
          port.setMultiport(portRule.isMultiport());
        }
      }
    }
 catch (    MalformedStringException e) {
      throw new IllegalActionException(null,e,"String_Node_Str");
    }
catch (    NameDuplicationException e) {
      throw new IllegalActionException(null,e,"String_Node_Str");
    }
 finally {
      _workspace.doneWriting();
    }
  }
}

Fixed version (ground truth):
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  super.attributeChanged(attribute);
  if (attribute == ruleList) {
    try {
      _workspace.getWriteAccess();
      Set<String> preservedPortNames=new HashSet<String>();
      for (      Rule rule : ruleList.getRuleList()) {
        if (rule instanceof PortRule) {
          PortRule portRule=(PortRule)rule;
          String portName=portRule.getPortName();
          preservedPortNames.add(portName);
          TypedIOPort port=(TypedIOPort)getPort(portName);
          if (port != null) {
            port.setInput(portRule.isInput());
            port.setOutput(portRule.isOutput());
            port.setMultiport(portRule.isMultiport());
            port.setPersistent(false);
          }
 else {
            port=new TypedIOPort(this,portRule.getPortName(),portRule.isInput(),portRule.isOutput());
            port.setMultiport(portRule.isMultiport());
            port.setPersistent(false);
          }
        }
      }
      List<?> portList=portList();
      for (int i=0; i < portList.size(); ) {
        Port port=(Port)portList.get(i);
        if (!preservedPortNames.contains(port.getName())) {
          port.setContainer(null);
        }
 else {
          i++;
        }
      }
      for (      Object portObject : portList()) {
        Port port=(Port)portObject;
        if (!preservedPortNames.contains(port.getName())) {
          port.setContainer(null);
        }
      }
    }
 catch (    MalformedStringException e) {
      throw new IllegalActionException(null,e,"String_Node_Str");
    }
catch (    NameDuplicationException e) {
      throw new IllegalActionException(null,e,"String_Node_Str");
    }
 finally {
      _workspace.doneWriting();
    }
  }
}
Program: 74663
Project: 74663
Buggy source:
private boolean _tryToMatchCompositeEntity(CompositeEntity lhsEntity,CompositeEntity hostEntity){
  FastLinkedList<MarkedEntityList> lhsMarkedList=new FastLinkedList<MarkedEntityList>();
  AtomicActor lhsNextActor=_findFirstAtomicActor(lhsEntity,lhsMarkedList,_match.keySet());
  _match.put(lhsEntity,hostEntity);
  if (lhsNextActor == null) {
    return true;
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
    FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
    FastLinkedList<MarkedEntityList> hostMarkedList=new FastLinkedList<MarkedEntityList>();
    AtomicActor hostNextActor=_findFirstAtomicActor(hostEntity,hostMarkedList,_match.values());
    while (hostNextActor != null) {
      _lhsFrontier.add(lhsNextActor);
      _hostFrontier.add(hostNextActor);
      if (_match(lhsTail.getNext(),hostTail.getNext())) {
        return true;
      }
 else {
        _hostFrontier.removeAllAfter(hostTail);
        _lhsFrontier.removeAllAfter(lhsTail);
        hostNextActor=_findNextAtomicActor(hostEntity,hostMarkedList,_match.values());
      }
    }
    _match.remove(lhsEntity);
    return false;
  }
}

Fixed version (ground truth):
private boolean _tryToMatchCompositeEntity(CompositeEntity lhsEntity,CompositeEntity hostEntity){
  FastLinkedList<MarkedEntityList> lhsMarkedList=new FastLinkedList<MarkedEntityList>();
  AtomicActor lhsNextActor=_findFirstAtomicActor(lhsEntity,lhsMarkedList,_match.keySet());
  boolean firstEntrance=!_match.containsKey(lhsEntity);
  if (firstEntrance) {
    _match.put(lhsEntity,hostEntity);
  }
  if (lhsNextActor == null) {
    return true;
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsTail=_lhsFrontier.getTail();
    FastLinkedList<NamedObj>.Entry hostTail=_hostFrontier.getTail();
    FastLinkedList<CompositeEntity>.Entry compositeTail=null;
    if (firstEntrance) {
      _visitedLHSCompositeEntities.add(lhsEntity);
      compositeTail=_visitedLHSCompositeEntities.getTail();
    }
    FastLinkedList<MarkedEntityList> hostMarkedList=new FastLinkedList<MarkedEntityList>();
    AtomicActor hostNextActor=_findFirstAtomicActor(hostEntity,hostMarkedList,_match.values());
    while (hostNextActor != null) {
      _lhsFrontier.add(lhsNextActor);
      _hostFrontier.add(hostNextActor);
      if (_match(lhsTail.getNext(),hostTail.getNext())) {
        return true;
      }
 else {
        _hostFrontier.removeAllAfter(hostTail);
        _lhsFrontier.removeAllAfter(lhsTail);
        if (firstEntrance) {
          _visitedLHSCompositeEntities.removeAllAfter(compositeTail);
        }
        hostNextActor=_findNextAtomicActor(hostEntity,hostMarkedList,_match.values());
      }
    }
    if (firstEntrance) {
      compositeTail.remove();
      _match.remove(lhsEntity);
    }
    return false;
  }
}
Program: 74664
Project: 74664
Buggy source:
private boolean _tryToMatch(NamedObj lhsObject,NamedObj hostObject){
  if (_match.containsKey(lhsObject)) {
    return _match.get(lhsObject) == hostObject && _checkDisconnectedComponents(_lhsFrontier.getTail(),_hostFrontier.getTail());
  }
 else   if (_match.containsValue(hostObject)) {
    return false;
  }
 else   if (lhsObject instanceof AtomicActor && hostObject instanceof AtomicActor) {
    return _tryToMatchAtomicActor((AtomicActor)lhsObject,(AtomicActor)hostObject);
  }
 else   if (lhsObject instanceof CompositeEntity && hostObject instanceof CompositeEntity) {
    return _tryToMatchCompositeEntity((CompositeEntity)lhsObject,(CompositeEntity)hostObject);
  }
 else   if (lhsObject instanceof Port && hostObject instanceof Port) {
    return _tryToMatchPort((Port)lhsObject,(Port)hostObject);
  }
 else   if (lhsObject instanceof Relation && hostObject instanceof Relation) {
    return _tryToMatchRelation((Relation)lhsObject,(Relation)hostObject);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean _tryToMatch(NamedObj lhsObject,NamedObj hostObject){
  if (_match.containsKey(lhsObject)) {
    return _match.get(lhsObject) == hostObject && _checkDisconnectedComponents();
  }
 else   if (_match.containsValue(hostObject)) {
    return false;
  }
 else   if (lhsObject instanceof AtomicActor && hostObject instanceof AtomicActor) {
    return _tryToMatchAtomicActor((AtomicActor)lhsObject,(AtomicActor)hostObject);
  }
 else   if (lhsObject instanceof CompositeEntity && hostObject instanceof CompositeEntity) {
    return _tryToMatchCompositeEntity((CompositeEntity)lhsObject,(CompositeEntity)hostObject);
  }
 else   if (lhsObject instanceof Port && hostObject instanceof Port) {
    return _tryToMatchPort((Port)lhsObject,(Port)hostObject);
  }
 else   if (lhsObject instanceof Relation && hostObject instanceof Relation) {
    return _tryToMatchRelation((Relation)lhsObject,(Relation)hostObject);
  }
 else {
    return false;
  }
}
Program: 74665
Project: 74665
Buggy source:
public void match(CompositeActorMatcher lhsGraph,NamedObj hostGraph) throws SubgraphMatchingException {
  _match=new FastHashMap<NamedObj,NamedObj>();
  _lhsFrontier=new FastLinkedList<NamedObj>();
  _hostFrontier=new FastLinkedList<NamedObj>();
  _lhsFrontier.add(lhsGraph);
  _hostFrontier.add(hostGraph);
  if (_match(_lhsFrontier.getHead(),_hostFrontier.getHead())) {
    for (    NamedObj lhsObject : _match.keySet()) {
      System.out.println(lhsObject.getName() + "String_Node_Str" + _match.get(lhsObject).getName());
    }
  }
}

Fixed version (ground truth):
public void match(CompositeActorMatcher lhsGraph,NamedObj hostGraph) throws SubgraphMatchingException {
  _match=new FastHashMap<NamedObj,NamedObj>();
  _lhsFrontier=new FastLinkedList<NamedObj>();
  _hostFrontier=new FastLinkedList<NamedObj>();
  _visitedLHSCompositeEntities=new FastLinkedList<CompositeEntity>();
  _lhsFrontier.add(lhsGraph);
  _hostFrontier.add(hostGraph);
  if (_match(_lhsFrontier.getHead(),_hostFrontier.getHead())) {
    for (    NamedObj lhsObject : _match.keySet()) {
      System.out.println(lhsObject.getName() + "String_Node_Str" + _match.get(lhsObject).getName());
    }
  }
  _lhsFrontier=null;
  _hostFrontier=null;
  _visitedLHSCompositeEntities=null;
}
Program: 74666
Project: 74666
Buggy source:
private boolean _matchLoop(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsChildStart=lhsStart.getNext();
  FastLinkedList<NamedObj>.Entry hostChildStart=hostStart.getNext();
  if (lhsChildStart == null) {
    return _checkDisconnectedComponents(lhsStart,hostStart);
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsEntry=lhsChildStart;
    boolean nestedMatch=false;
    while (lhsEntry != null) {
      nestedMatch=true;
      if (!_match(lhsEntry,hostChildStart)) {
        return false;
      }
      lhsEntry=lhsEntry.getNext();
    }
    if (nestedMatch) {
      return true;
    }
 else {
      return _checkDisconnectedComponents(lhsChildStart,lhsEntry);
    }
  }
}

Fixed version (ground truth):
private boolean _matchLoop(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsChildStart=lhsStart.getNext();
  FastLinkedList<NamedObj>.Entry hostChildStart=hostStart.getNext();
  if (lhsChildStart == null) {
    return _checkDisconnectedComponents();
  }
 else {
    FastLinkedList<NamedObj>.Entry lhsEntry=lhsChildStart;
    boolean nestedMatch=false;
    while (lhsEntry != null) {
      nestedMatch=true;
      if (!_match(lhsEntry,hostChildStart)) {
        return false;
      }
      lhsEntry=lhsEntry.getNext();
    }
    if (nestedMatch) {
      return true;
    }
 else {
      return _checkDisconnectedComponents();
    }
  }
}
Program: 74667
Project: 74667
Buggy source:
private boolean _checkDisconnectedComponents(FastLinkedList<NamedObj>.Entry lhsStart,FastLinkedList<NamedObj>.Entry hostStart){
  FastLinkedList<NamedObj>.Entry lhsEntry=lhsStart;
  while (lhsEntry != null) {
    NamedObj lhsObject=lhsEntry.getValue();
    if (lhsObject instanceof CompositeEntity) {
      CompositeEntity lhsEntity=(CompositeEntity)lhsObject;
      int size;
      do {
        size=_match.size();
        if (_match.containsKey(lhsEntity) && !_tryToMatchCompositeEntity(lhsEntity,(CompositeEntity)_match.get(lhsEntity))) {
          return false;
        }
      }
 while (_match.size() > size);
    }
    lhsEntry=lhsEntry.getPrevious();
  }
  return true;
}

Fixed version (ground truth):
private boolean _checkDisconnectedComponents(){
  FastLinkedList<CompositeEntity>.Entry lhsEntry=_visitedLHSCompositeEntities.getTail();
  while (lhsEntry != null) {
    CompositeEntity lhsEntity=lhsEntry.getValue();
    if (!_tryToMatchCompositeEntity(lhsEntity,(CompositeEntity)_match.get(lhsEntity))) {
      return false;
    }
    lhsEntry=lhsEntry.getPrevious();
  }
  return true;
}