Program: 72773
Project: 72773
Buggy source:
public void saveModel() throws NameDuplicationException {
  for (int i=0; i < getRowCount() - 1; i++) {
    String expression="String_Node_Str";
    State state=(State)_model.getEntity((String)getValueAt(i,0));
    String condition="String_Node_Str";
    String value="String_Node_Str";
    for (int j=0; j < getColumnCount() - 1; j++) {
      int contentIndex=SCRTableHelper.getContentIndex(i,j,getColumnCount());
      condition=(String)getValueAt(i,j + 1);
      value=(String)getValueAt(getRowCount() - 1,j + 1);
      expression=expression + "String_Node_Str" + condition+ "String_Node_Str"+ value+ "String_Node_Str";
    }
    expression=expression + "String_Node_Str" + value;
    for (int j=0; j < getColumnCount() - 1; j++) {
      expression=expression + "String_Node_Str";
    }
    try {
      if (state.getRefinement() == null) {
        ((RefinementActor)state.getContainer()).addRefinement(state,((CompositeEntity)_model).uniqueName(state.getName() + "String_Node_Str"),null,Refinement.class.getName(),null);
      }
      CompositeEntity entity=(CompositeEntity)state.getRefinement()[0];
      if (entity.attributeList(Director.class).size() == 0) {
        ContinuousDirector director=new ContinuousDirector(entity,"String_Node_Str");
      }
      Object expressionActorObject=entity.getEntity(_port.getName() + "String_Node_Str");
      TypedIORelation relation=null;
      if (expressionActorObject == null) {
        expressionActorObject=new Expression(entity,_port.getName() + "String_Node_Str");
        relation=new TypedIORelation(entity,entity.uniqueName("String_Node_Str"));
      }
      Expression expressionActor=(Expression)expressionActorObject;
      expressionActor.expression.setExpression(expression);
      if (relation != null) {
        expressionActor.output.link(relation);
        IOPort port=(IOPort)((CompositeActor)entity).getPort(_port.getName());
        port.link(relation);
      }
    }
 catch (    IllegalActionException e1) {
      e1.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void saveModel() throws NameDuplicationException {
  for (int i=0; i < getRowCount() - 1; i++) {
    StringBuffer expression=new StringBuffer();
    State state=(State)_model.getEntity((String)getValueAt(i,0));
    String condition="String_Node_Str";
    String value="String_Node_Str";
    for (int j=0; j < getColumnCount() - 1; j++) {
      int contentIndex=SCRTableHelper.getContentIndex(i,j,getColumnCount());
      condition=(String)getValueAt(i,j + 1);
      value=(String)getValueAt(getRowCount() - 1,j + 1);
      expression=expression.append("String_Node_Str" + condition + "String_Node_Str"+ value+ "String_Node_Str");
    }
    expression=expression.append("String_Node_Str" + value);
    for (int j=0; j < getColumnCount() - 1; j++) {
      expression=expression.append(expression + "String_Node_Str");
    }
    try {
      if (state.getRefinement() == null) {
        ((RefinementActor)state.getContainer()).addRefinement(state,((CompositeEntity)_model).uniqueName(state.getName() + "String_Node_Str"),null,Refinement.class.getName(),null);
      }
      CompositeEntity entity=(CompositeEntity)state.getRefinement()[0];
      if (entity.attributeList(Director.class).size() == 0) {
        ContinuousDirector director=new ContinuousDirector(entity,"String_Node_Str");
      }
      Object expressionActorObject=entity.getEntity(_port.getName() + "String_Node_Str");
      TypedIORelation relation=null;
      if (expressionActorObject == null) {
        expressionActorObject=new Expression(entity,_port.getName() + "String_Node_Str");
        relation=new TypedIORelation(entity,entity.uniqueName("String_Node_Str"));
      }
      Expression expressionActor=(Expression)expressionActorObject;
      expressionActor.expression.setExpression(expression.toString());
      if (relation != null) {
        expressionActor.output.link(relation);
        IOPort port=(IOPort)((CompositeActor)entity).getPort(_port.getName());
        port.link(relation);
      }
    }
 catch (    IllegalActionException e1) {
      e1.printStackTrace();
    }
  }
}