Program: 74261
Project: 74261
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();
    }
    TransformationMode.Mode modeValue=(TransformationMode.Mode)mode.getChosenValue();
    if (modelInput.hasToken(0)) {
      ActorToken token=(ActorToken)modelInput.get(0);
      _lastModel=(CompositeEntity)token.getEntity(new Workspace());
      _lastModel.setDeferringChangeRequests(false);
      _lastResults.clear();
      TransformationRule workingCopy=mode.getWorkingCopy(this);
      for (      Object parameterObject : attributeList()) {
        if (parameterObject instanceof PortParameter) {
          PortParameter param=(PortParameter)parameterObject;
          Token paramToken=param.getToken();
          PortParameter paramCopy=(PortParameter)workingCopy.getAttribute(param.getName());
          paramCopy.setToken(paramToken);
        }
      }
      if (modeValue == null) {
        _lastResults=mode.findAllMatches(workingCopy,_lastModel);
      }
 else {
        boolean untilFixpoint=((BooleanToken)repeatUntilFixpoint.getToken()).booleanValue();
        long count=LongToken.convert(repeatCount.getToken()).longValue();
        boolean matchOnly=mode.isMatchOnly();
        boolean foundMatch=count > 0;
        while (foundMatch) {
          foundMatch=mode.transform(workingCopy,_lastModel);
          if (matchOnly || !untilFixpoint && --count <= 0) {
            break;
          }
        }
        if (!matchOnly) {
          modelOutput.send(0,new ActorToken(_lastModel));
        }
        matched.send(0,BooleanToken.getInstance(foundMatch));
      }
    }
    if (modeValue != null) {
      return;
    }
    if (matchInput.isOutsideConnected() && matchInput.hasToken(0) && _lastModel != null) {
      ObjectToken token=(ObjectToken)matchInput.get(0);
      MatchResult match=(MatchResult)token.getValue();
      if (match != null) {
        TransformationRule workingCopy=mode.getWorkingCopy(this);
        CompositeEntity host=(CompositeEntity)match.get(workingCopy.getPattern());
        if (_lastModel != host && !_lastModel.deepContains(host)) {
          throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
        }
        GraphTransformer.transform(workingCopy,match);
        modelOutput.send(0,new ActorToken(_lastModel));
      }
    }
    if (trigger.isOutsideConnected() && trigger.hasToken(0) && !_lastResults.isEmpty()) {
      trigger.get(0);
      _removeFirst=true;
      MatchResult result=_lastResults.get(0);
      matchOutput.send(0,new ObjectToken(result));
    }
    remaining.send(0,new IntToken(_lastResults.size()));
  }
 catch (  TransformationException e) {
    throw new IllegalActionException(this,e,"String_Node_Str");
  }
}

Fixed version (ground truth):
public void fire() throws IllegalActionException {
  try {
    _workspace.getReadAccess();
    for (    Object parameterObject : attributeList()) {
      if (parameterObject instanceof PortParameter) {
        ((PortParameter)parameterObject).update();
      }
    }
  }
  finally {
    _workspace.doneReading();
  }
  TransformationMode.Mode modeValue=(TransformationMode.Mode)mode.getChosenValue();
  if (modelInput.hasToken(0)) {
    ActorToken token=(ActorToken)modelInput.get(0);
    _lastModel=(CompositeEntity)token.getEntity(new Workspace());
    _lastModel.setDeferringChangeRequests(false);
    _lastResults.clear();
    TransformationRule workingCopy=mode.getWorkingCopy(this);
    for (    Object parameterObject : attributeList()) {
      if (parameterObject instanceof PortParameter) {
        PortParameter param=(PortParameter)parameterObject;
        Token paramToken=param.getToken();
        PortParameter paramCopy=(PortParameter)workingCopy.getAttribute(param.getName());
        paramCopy.setToken(paramToken);
      }
    }
    if (modeValue == null) {
      _lastResults=mode.findAllMatches(workingCopy,_lastModel);
    }
 else {
      boolean untilFixpoint=((BooleanToken)repeatUntilFixpoint.getToken()).booleanValue();
      long count=LongToken.convert(repeatCount.getToken()).longValue();
      boolean matchOnly=mode.isMatchOnly();
      boolean foundMatch=count > 0;
      try {
        while (foundMatch) {
          foundMatch=mode.transform(workingCopy,_lastModel);
          if (matchOnly || !untilFixpoint && --count <= 0) {
            break;
          }
        }
      }
 catch (      Throwable t) {
        throw new IllegalActionException(this,t,"String_Node_Str" + "String_Node_Str" + getFullName() + "String_Node_Str");
      }
      if (!matchOnly) {
        modelOutput.send(0,new ActorToken(_lastModel));
      }
      matched.send(0,BooleanToken.getInstance(foundMatch));
    }
  }
  if (modeValue != null) {
    return;
  }
  if (matchInput.isOutsideConnected() && matchInput.hasToken(0) && _lastModel != null) {
    ObjectToken token=(ObjectToken)matchInput.get(0);
    MatchResult match=(MatchResult)token.getValue();
    if (match != null) {
      TransformationRule workingCopy=mode.getWorkingCopy(this);
      CompositeEntity host=(CompositeEntity)match.get(workingCopy.getPattern());
      if (_lastModel != host && !_lastModel.deepContains(host)) {
        throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
      }
      try {
        GraphTransformer.transform(workingCopy,match);
      }
 catch (      Throwable t) {
        throw new IllegalActionException(this,t,"String_Node_Str" + "String_Node_Str" + getFullName() + "String_Node_Str");
      }
      modelOutput.send(0,new ActorToken(_lastModel));
    }
  }
  if (trigger.isOutsideConnected() && trigger.hasToken(0) && !_lastResults.isEmpty()) {
    trigger.get(0);
    _removeFirst=true;
    MatchResult result=_lastResults.get(0);
    matchOutput.send(0,new ObjectToken(result));
  }
  remaining.send(0,new IntToken(_lastResults.size()));
}