Program: 74435
Project: 74435
Buggy source:
public void fire() throws IllegalActionException {
  try {
    try {
      _workspace.getReadAccess();
      for (      Object parameterObject : attributeList()) {
        if (parameterObject instanceof PortParameter) {
          ((PortParameter)parameterObject).update();
        }
      }
    }
  finally {
      _workspace.doneReading();
    }
    if (modelInput.hasToken(0)) {
      ActorToken token=(ActorToken)modelInput.get(0);
      _lastModel=(CompositeEntity)token.getEntity();
      _lastModel.setDeferringChangeRequests(false);
      Mode mode=_getMode();
      GraphMatcher matcher=new GraphMatcher();
      matcher.setMatchCallback(this);
      _collectAllMatches=mode != Mode.REPLACE_FIRST;
      _lastResults.clear();
      matcher.match(getPattern(),_lastModel);
      if (mode == Mode.REPLACE_FIRST || mode == Mode.REPLACE_ANY || mode == Mode.REPLACE_ALL) {
        boolean foundMatch=!_lastResults.isEmpty();
        if (foundMatch) {
          boolean repeat=((BooleanToken)repeatUntilFixpoint.getToken()).booleanValue();
          while (!_lastResults.isEmpty()) {
switch (mode) {
case REPLACE_FIRST:
              MatchResult result=_lastResults.peek();
            GraphTransformer.transform(this,result);
          break;
case REPLACE_ANY:
        result=_lastResults.get(_random.nextInt(_lastResults.size()));
      GraphTransformer.transform(this,result);
    break;
case REPLACE_ALL:
  GraphTransformer.transform(this,_lastResults);
break;
}
if (!repeat) {
break;
}
_lastResults.clear();
matcher.match(getPattern(),_lastModel);
}
}
modelOutput.send(0,new ActorToken(_lastModel));
modified.send(0,BooleanToken.getInstance(foundMatch));
return;
}
}
if (matchInput.getWidth() > 0 && matchInput.hasToken(0) && _lastModel != null) {
ObjectToken token=(ObjectToken)matchInput.get(0);
MatchResult match=(MatchResult)token.getValue();
if (match != null) {
CompositeEntity host=(CompositeEntity)match.get(getPattern());
if (_lastModel != host && !_lastModel.deepContains(host)) {
throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
}
GraphTransformer.transform(this,match);
modelOutput.send(0,new ActorToken(_lastModel));
}
}
if (trigger.getWidth() > 0 && trigger.hasToken(0) && !_lastResults.isEmpty()) {
trigger.get(0);
_lastResultsOperation=LastResultsOperation.REMOVE_FIRST;
MatchResult result=_lastResults.peek();
matchOutput.send(0,new ObjectToken(result));
}
}
 catch (TransformationException e) {
throw new IllegalActionException(this,e,"String_Node_Str");
}
remaining.send(0,new IntToken(_lastResults.size()));
}

Fixed version (ground truth):
public void fire() throws IllegalActionException {
  try {
    try {
      _workspace.getReadAccess();
      for (      Object parameterObject : attributeList()) {
        if (parameterObject instanceof PortParameter) {
          ((PortParameter)parameterObject).update();
        }
      }
    }
  finally {
      _workspace.doneReading();
    }
    if (modelInput.hasToken(0)) {
      ActorToken token=(ActorToken)modelInput.get(0);
      _lastModel=(CompositeEntity)token.getEntity();
      _lastModel.setDeferringChangeRequests(false);
      Mode mode=_getMode();
      GraphMatcher matcher=new GraphMatcher();
      matcher.setMatchCallback(this);
      _collectAllMatches=mode != Mode.REPLACE_FIRST;
      _lastResults.clear();
      matcher.match(getPattern(),_lastModel);
      if (mode == Mode.REPLACE_FIRST || mode == Mode.REPLACE_ANY || mode == Mode.REPLACE_ALL) {
        boolean foundMatch=!_lastResults.isEmpty();
        if (foundMatch) {
          boolean untilFixpoint=((BooleanToken)repeatUntilFixpoint.getToken()).booleanValue();
          long count=LongToken.convert(repeatCount.getToken()).longValue();
          while (!_lastResults.isEmpty()) {
            if (count <= 0) {
              break;
            }
switch (mode) {
case REPLACE_FIRST:
              MatchResult result=_lastResults.peek();
            GraphTransformer.transform(this,result);
          break;
case REPLACE_ANY:
        result=_lastResults.get(_random.nextInt(_lastResults.size()));
      GraphTransformer.transform(this,result);
    break;
case REPLACE_ALL:
  GraphTransformer.transform(this,_lastResults);
break;
}
if (!untilFixpoint && --count <= 0) {
break;
}
_lastResults.clear();
matcher.match(getPattern(),_lastModel);
}
}
modelOutput.send(0,new ActorToken(_lastModel));
modified.send(0,BooleanToken.getInstance(foundMatch));
return;
}
}
if (matchInput.getWidth() > 0 && matchInput.hasToken(0) && _lastModel != null) {
ObjectToken token=(ObjectToken)matchInput.get(0);
MatchResult match=(MatchResult)token.getValue();
if (match != null) {
CompositeEntity host=(CompositeEntity)match.get(getPattern());
if (_lastModel != host && !_lastModel.deepContains(host)) {
throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
}
GraphTransformer.transform(this,match);
modelOutput.send(0,new ActorToken(_lastModel));
}
}
if (trigger.getWidth() > 0 && trigger.hasToken(0) && !_lastResults.isEmpty()) {
trigger.get(0);
_lastResultsOperation=LastResultsOperation.REMOVE_FIRST;
MatchResult result=_lastResults.peek();
matchOutput.send(0,new ObjectToken(result));
}
}
 catch (TransformationException e) {
throw new IllegalActionException(this,e,"String_Node_Str");
}
remaining.send(0,new IntToken(_lastResults.size()));
}