nus-yam/ex-repair huggingface dataset:
Program: 167474
Project: 167474
Buggy source:
private void convertAttributeSettingsToAttributeFormat(){
  List<ComponentAttributeSetting> attributeSettings=getComponent().getAttributeSettings();
  Map<String,AttributeFormat> formats=new HashMap<String,DelimitedParser.AttributeFormat>();
  for (  ComponentAttributeSetting attributeSetting : attributeSettings) {
    AttributeFormat format=formats.get(attributeSetting.getAttributeId());
    if (format == null) {
      Model inputModel=getComponent().getOutputModel();
      ModelAttribute attribute=inputModel.getAttributeById(attributeSetting.getAttributeId());
      if (attribute != null) {
        ModelEntity entity=inputModel.getEntityById(attribute.getEntityId());
        format=new AttributeFormat(attributeSetting.getAttributeId(),entity,attribute);
        formats.put(attributeSetting.getAttributeId(),format);
        if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_ORDINAL)) {
          format.setOrdinal(Integer.parseInt(attributeSetting.getValue()));
        }
 else         if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_FORMAT_FUNCTION)) {
          format.setFormatFunction(attributeSetting.getValue());
        }
      }
    }
  }
  attributes.addAll(formats.values());
  Collections.sort(attributes,new Comparator<AttributeFormat>(){
    @Override public int compare(    AttributeFormat ordinal1,    AttributeFormat ordinal2){
      return ordinal1.getOrdinal() - ordinal2.getOrdinal();
    }
  }
);
}

Fixed version (ground truth):
private void convertAttributeSettingsToAttributeFormat(){
  List<ComponentAttributeSetting> attributeSettings=getComponent().getAttributeSettings();
  Map<String,AttributeFormat> formats=new HashMap<String,DelimitedParser.AttributeFormat>();
  for (  ComponentAttributeSetting attributeSetting : attributeSettings) {
    AttributeFormat format=formats.get(attributeSetting.getAttributeId());
    if (format == null) {
      Model inputModel=getComponent().getOutputModel();
      ModelAttribute attribute=inputModel.getAttributeById(attributeSetting.getAttributeId());
      ModelEntity entity=inputModel.getEntityById(attribute.getEntityId());
      if (attribute != null) {
        format=new AttributeFormat(attributeSetting.getAttributeId(),entity,attribute);
        formats.put(attributeSetting.getAttributeId(),format);
      }
    }
    if (format != null) {
      if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_ORDINAL)) {
        format.setOrdinal(Integer.parseInt(attributeSetting.getValue()));
      }
 else       if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_FORMAT_FUNCTION)) {
        format.setFormatFunction(attributeSetting.getValue());
      }
    }
  }
  attributes.addAll(formats.values());
  Collections.sort(attributes,new Comparator<AttributeFormat>(){
    @Override public int compare(    AttributeFormat ordinal1,    AttributeFormat ordinal2){
      return ordinal1.getOrdinal() - ordinal2.getOrdinal();
    }
  }
);
}
Program: 167475
Project: 167475
Buggy source:
private void shutdown(MessageTarget target) throws InterruptedException {
  this.componentRuntime.lastMessageReceived(target);
  for (  StepRuntime targetStepRuntime : targetStepRuntimes) {
    targetStepRuntime.queue(new ShutdownMessage(componentRuntime.getComponentContext().getFlowStep().getId(),cancelled));
  }
  this.componentRuntime.stop();
  running=false;
  executionTracker.flowStepFinished(componentRuntime.getComponentContext(),error,cancelled);
}

Fixed version (ground truth):
private void shutdown(MessageTarget target) throws InterruptedException {
  this.componentRuntime.lastMessageReceived(target);
  for (  StepRuntime targetStepRuntime : targetStepRuntimes) {
    targetStepRuntime.queue(new ShutdownMessage(componentRuntime.getComponentContext().getFlowStep().getId(),cancelled));
  }
  try {
    this.componentRuntime.stop();
  }
 catch (  Exception e) {
    recordError(e);
  }
  running=false;
  executionTracker.flowStepFinished(componentRuntime.getComponentContext(),error,cancelled);
}
Program: 167476
Project: 167476
Buggy source:
@Override protected void start(TypedProperties properties){
  streamable=new HttpStreamable(properties.get(URL),properties.get(HTTP_METHOD,HTTP_METHOD_GET),properties.getInt(HTTP_TIMEOUT),properties.get(SECURITY),properties.get(SECURITY_USERNAME),properties.get(SECURITY_PASSWORD));
}

Fixed version (ground truth):
@Override protected void start(TypedProperties properties){
  streamable=new HttpStreamable(properties.get(URL),properties.get(HTTP_METHOD,HTTP_METHOD_GET),properties.get(CONTENT_TYPE),properties.getInt(HTTP_TIMEOUT),properties.get(SECURITY),properties.get(SECURITY_USERNAME),properties.get(SECURITY_PASSWORD));
}
Program: 167477
Project: 167477
Buggy source:
@Override public InputStream getInputStream(String relativePath,boolean mustExist){
  try {
    HttpURLConnection httpConnection=buildHttpUrlConnection();
    int responseCode=httpConnection.getResponseCode();
    if (responseCode == 200) {
      String type=httpConnection.getContentEncoding();
      InputStream in=httpConnection.getInputStream();
      if (!isBlank(type) && type.equals("String_Node_Str")) {
        in=new GZIPInputStream(in);
      }
      return in;
    }
 else {
      throw new IoException("String_Node_Str" + responseCode);
    }
  }
 catch (  IOException e) {
    throw new IoException(e);
  }
}

Fixed version (ground truth):
@Override public InputStream getInputStream(String relativePath,boolean mustExist){
  try {
    HttpURLConnection httpConnection=buildHttpUrlConnection(relativePath);
    int responseCode=httpConnection.getResponseCode();
    if (responseCode == 200) {
      String type=httpConnection.getContentEncoding();
      InputStream in=httpConnection.getInputStream();
      if (!isBlank(type) && type.equals("String_Node_Str")) {
        in=new GZIPInputStream(in);
      }
      return in;
    }
 else {
      throw new IoException("String_Node_Str" + responseCode);
    }
  }
 catch (  IOException e) {
    throw new IoException(e);
  }
}
Program: 167478
Project: 167478
Buggy source:
protected HttpURLConnection buildHttpUrlConnection(){
  try {
    HttpURLConnection httpUrlConnection=(HttpURLConnection)new URL(url).openConnection();
    setBasicAuthIfNeeded(httpUrlConnection);
    httpUrlConnection.setConnectTimeout(timeout);
    httpUrlConnection.setReadTimeout(timeout);
    httpUrlConnection.setRequestMethod(httpMethod);
    httpUrlConnection.setDoOutput(true);
    httpUrlConnection.setDoInput(true);
    return httpUrlConnection;
  }
 catch (  Exception e) {
    throw new IoException(e);
  }
}

Fixed version (ground truth):
protected HttpURLConnection buildHttpUrlConnection(String relativePath){
  try {
    String fullUrl=url;
    if (isNotBlank(relativePath)) {
      fullUrl+=relativePath;
    }
    HttpURLConnection httpUrlConnection=(HttpURLConnection)new URL(fullUrl).openConnection();
    setBasicAuthIfNeeded(httpUrlConnection);
    if (isNotBlank(contentType)) {
      httpUrlConnection.setRequestProperty("String_Node_Str",contentType);
    }
    httpUrlConnection.setConnectTimeout(timeout);
    httpUrlConnection.setReadTimeout(timeout);
    httpUrlConnection.setRequestMethod(httpMethod);
    httpUrlConnection.setDoOutput(true);
    httpUrlConnection.setDoInput(true);
    return httpUrlConnection;
  }
 catch (  Exception e) {
    throw new IoException(e);
  }
}
Program: 167479
Project: 167479
Buggy source:
public HttpStreamable(String url,String httpMethod,int timeout,String security,String username,String password){
  this.url=url;
  this.httpMethod=httpMethod;
  this.timeout=timeout;
  this.security=security;
  this.username=username;
  this.password=password;
}

Fixed version (ground truth):
public HttpStreamable(String url,String httpMethod,String contentType,int timeout,String security,String username,String password){
  this.url=url;
  this.httpMethod=httpMethod;
  this.contentType=contentType;
  this.timeout=timeout;
  this.security=security;
  this.username=username;
  this.password=password;
}
Program: 167480
Project: 167480
Buggy source:
@Override public OutputStream getOutputStream(String relativePath,boolean mustExist){
  HttpURLConnection httpUrlConnection=buildHttpUrlConnection();
  return new HttpOutputStream(httpUrlConnection);
}

Fixed version (ground truth):
@Override public OutputStream getOutputStream(String relativePath,boolean mustExist){
  HttpURLConnection httpUrlConnection=buildHttpUrlConnection(relativePath);
  return new HttpOutputStream(httpUrlConnection);
}
Program: 167481
Project: 167481
Buggy source:
@Override protected void start(TypedProperties properties){
  streamableResource=new ScpStreamable(resource,properties.getProperty(SSH_SERVER),properties.getInt(SSH_PORT),properties.getProperty(SSH_USER),properties.getProperty(SSH_PASSWORD),properties.getProperty(SSH_BASE_PATH),properties.getInt(SSH_CONNECTION_TIMEOUT),properties.is(SSH_MUST_EXIST));
}

Fixed version (ground truth):
@Override protected void start(TypedProperties properties){
  streamableResource=new ScpStreamable(resource,properties.getProperty(SCP_SERVER),properties.getInt(SCP_PORT),properties.getProperty(SCP_USER),properties.getProperty(SCP_PASSWORD),properties.getProperty(SCP_BASE_PATH),properties.getInt(SCP_CONNECTION_TIMEOUT),properties.is(SCP_MUST_EXIST));
}
Program: 167483
Project: 167483
Buggy source:
protected void setMenuItemsEnabled(){
  Object selected=treeTable.getValue();
  editMenu.setEnabled(false);
  newMenu.setEnabled(true);
  blank.setVisible(false);
  newComponent.setVisible(false);
  newFlow.setVisible(false);
  newModel.setVisible(false);
  newDataSource.setVisible(false);
  newFileResource.setVisible(false);
  if (selected instanceof FolderName) {
    FolderName folder=(FolderName)selected;
    if (folder.getName().equals("String_Node_Str")) {
      newFlow.setVisible(true);
    }
 else     if (folder.getName().equals("String_Node_Str")) {
      newModel.setVisible(true);
    }
 else     if (folder.getName().equals("String_Node_Str")) {
      newDataSource.setVisible(true);
      newFileResource.setVisible(true);
    }
 else {
      blank.setVisible(true);
      newMenu.setEnabled(false);
    }
  }
 else {
    blank.setVisible(true);
    newMenu.setEnabled(false);
    if (selected != null && !(selected instanceof ProjectVersion)) {
      editMenu.setEnabled(true);
    }
  }
  closeProject.setEnabled(selected instanceof ProjectVersion);
  exportProject.setEnabled(selected instanceof ProjectVersion);
  boolean deleteEnabled=false;
  deleteEnabled|=isDeleteButtonEnabled(treeTable.getValue());
  delete.setEnabled(deleteEnabled);
}

Fixed version (ground truth):
protected void setMenuItemsEnabled(){
  Object selected=treeTable.getValue();
  editMenu.setEnabled(false);
  newMenu.setEnabled(true);
  blank.setVisible(false);
  newComponent.setVisible(false);
  newFlow.setVisible(false);
  newModel.setVisible(false);
  newDataSource.setVisible(false);
  newSSHResource.setVisible(false);
  newWebResource.setVisible(false);
  newFileResource.setVisible(false);
  if (selected instanceof FolderName) {
    FolderName folder=(FolderName)selected;
    if (folder.getName().equals("String_Node_Str")) {
      newFlow.setVisible(true);
    }
 else     if (folder.getName().equals("String_Node_Str")) {
      newModel.setVisible(true);
    }
 else     if (folder.getName().equals("String_Node_Str")) {
      newDataSource.setVisible(true);
      newFileResource.setVisible(true);
      newWebResource.setVisible(true);
      newSSHResource.setVisible(true);
    }
 else {
      blank.setVisible(true);
      newMenu.setEnabled(false);
    }
  }
 else {
    blank.setVisible(true);
    newMenu.setEnabled(false);
    if (selected != null && !(selected instanceof ProjectVersion)) {
      editMenu.setEnabled(true);
    }
  }
  closeProject.setEnabled(selected instanceof ProjectVersion);
  exportProject.setEnabled(selected instanceof ProjectVersion);
  boolean deleteEnabled=false;
  deleteEnabled|=isDeleteButtonEnabled(treeTable.getValue());
  delete.setEnabled(deleteEnabled);
}
Program: 167484
Project: 167484
Buggy source:
@Override protected void start(){
  delimiter=getComponent().get(SETTING_DELIMITER,delimiter);
  quoteCharacter=getComponent().get(SETTING_QUOTE_CHARACTER,quoteCharacter);
  encoding=getComponent().get(SETTING_ENCODING,encoding);
  convertAttributeSettingsToAttributeFormat();
  if (getComponent().getOutputModel() == null) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected void start(){
  delimiter=getComponent().get(SETTING_DELIMITER,delimiter);
  quoteCharacter=getComponent().get(SETTING_QUOTE_CHARACTER,quoteCharacter);
  encoding=getComponent().get(SETTING_ENCODING,encoding);
  numberOfFooterLinesToSkip=getComponent().getInt(SETTING_FOOTER_LINES_TO_SKIP,0);
  numberOfHeaderLinesToSkip=getComponent().getInt(SETTING_HEADER_LINES_TO_SKIP,0);
  convertAttributeSettingsToAttributeFormat();
  if (getComponent().getOutputModel() == null) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 167485
Project: 167485
Buggy source:
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  getComponentStatistics().incrementInboundMessages();
  ArrayList<String> inputRows=inputMessage.getPayload();
  ArrayList<EntityData> outputPayload=new ArrayList<EntityData>();
  Message outputMessage=inputMessage.copy(getFlowStepId(),outputPayload);
  try {
    for (    String inputRow : inputRows) {
      EntityData data=processInputRow(inputRow);
      if (data != null) {
        outputPayload.add(data);
      }
    }
  }
 catch (  IOException e) {
    throw new IoException(e);
  }
  log(LogLevel.INFO,outputPayload.toString());
  getComponentStatistics().incrementOutboundMessages();
  outputMessage.getHeader().setSequenceNumber(getComponentStatistics().getNumberOutboundMessages());
  outputMessage.getHeader().setLastMessage(inputMessage.getHeader().isLastMessage());
  messageTarget.put(outputMessage);
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  getComponentStatistics().incrementInboundMessages();
  ArrayList<String> inputRows=inputMessage.getPayload();
  ArrayList<EntityData> outputPayload=new ArrayList<EntityData>();
  Message outputMessage=inputMessage.copy(getFlowStepId(),outputPayload);
  int headerRowsToSkip=numberOfHeaderLinesToSkip;
  try {
    int rowCount=0;
    for (    String inputRow : inputRows) {
      if (headerRowsToSkip == 0) {
        if (rowCount + numberOfFooterLinesToSkip < inputRows.size()) {
          EntityData data=processInputRow(inputRow);
          if (data != null) {
            outputPayload.add(data);
          }
        }
      }
 else {
        headerRowsToSkip--;
      }
      rowCount++;
    }
  }
 catch (  IOException e) {
    throw new IoException(e);
  }
  log(LogLevel.INFO,outputPayload.toString());
  getComponentStatistics().incrementOutboundMessages();
  outputMessage.getHeader().setSequenceNumber(getComponentStatistics().getNumberOutboundMessages());
  outputMessage.getHeader().setLastMessage(inputMessage.getHeader().isLastMessage());
  messageTarget.put(outputMessage);
}
Program: 167486
Project: 167486
Buggy source:
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  getComponentStatistics().incrementInboundMessages();
  if (currentSequence == null) {
    final String sqlToExecute=FormatUtils.replaceTokens(this.sql,context.getFlowParametersAsString(),true);
    log(LogLevel.DEBUG,"String_Node_Str" + sqlToExecute);
    currentSequence=getJdbcTemplate().queryForObject(sqlToExecute,context.getFlowParameters(),Long.class);
  }
  if (!(inputMessage instanceof StartupMessage)) {
    ArrayList<EntityData> outgoingPayload=new ArrayList<EntityData>();
    ArrayList<EntityData> payload=inputMessage.getPayload();
    for (    EntityData entityData : payload) {
      entityData=entityData.copy();
      entityData.put(sequenceAttributeId,++currentSequence);
      getComponentStatistics().incrementNumberEntitiesProcessed();
      outgoingPayload.add(entityData);
    }
    sendMessage(outgoingPayload,messageTarget,inputMessage.getHeader().isLastMessage());
  }
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  getComponentStatistics().incrementInboundMessages();
  if (currentSequence == null) {
    final String sqlToExecute=FormatUtils.replaceTokens(this.sql,context.getFlowParametersAsString(),true);
    log(LogLevel.DEBUG,"String_Node_Str" + sqlToExecute);
    currentSequence=getJdbcTemplate().queryForObject(sqlToExecute,context.getFlowParameters(),Long.class);
    if (currentSequence == null) {
      currentSequence=1l;
    }
  }
  if (!(inputMessage instanceof StartupMessage)) {
    ArrayList<EntityData> outgoingPayload=new ArrayList<EntityData>();
    ArrayList<EntityData> payload=inputMessage.getPayload();
    for (    EntityData entityData : payload) {
      entityData=entityData.copy();
      entityData.put(sequenceAttributeId,++currentSequence);
      getComponentStatistics().incrementNumberEntitiesProcessed();
      outgoingPayload.add(entityData);
    }
    sendMessage(outgoingPayload,messageTarget,inputMessage.getHeader().isLastMessage());
  }
}
Program: 167487
Project: 167487
Buggy source:
@Override public void save(ModelEntityRelationship modelEntityRelationship){
  save((AbstractObject)modelEntityRelationship);
  for (  ModelAttributeRelationship attributeRelationship : modelEntityRelationship.getAttributeRelationships()) {
    save(attributeRelationship);
  }
}

Fixed version (ground truth):
@Override public void save(ModelEntity modelEntity){
  save((AbstractObject)modelEntity);
  for (  ModelAttribute modelAttribute : modelEntity.getModelAttributes()) {
    save(modelAttribute);
  }
}
Program: 167488
Project: 167488
Buggy source:
@Override public void delete(ModelAttributeRelationship modelAttributeRelationship){
  persistenceManager.delete(modelAttributeRelationship,null,null,tableName(ModelAttributeRelationship.class));
}

Fixed version (ground truth):
@Override public void delete(ModelAttribute modelAttribute){
  List<ComponentAttributeSetting> attributeSettings=persistenceManager.find(ComponentAttributeSetting.class,new NameValue("String_Node_Str",modelAttribute.getId()),null,null,tableName(ComponentAttributeSetting.class));
  for (  ComponentAttributeSetting setting : attributeSettings) {
    delete(setting);
  }
  persistenceManager.delete(modelAttribute,null,null,tableName(ModelAttribute.class));
}
Program: 167489
Project: 167489
Buggy source:
@Override public void deleteFlow(Flow flow){
  flow.setDeleted(true);
  save((AbstractObject)flow);
}

Fixed version (ground truth):
@Override public void deleteFlow(Flow flow){
  flow.setDeleted(true);
  List<FlowStep> steps=flow.getFlowSteps();
  for (  FlowStep flowStep : steps) {
    if (!flowStep.getComponent().isShared()) {
      flowStep.getComponent().setDeleted(true);
      save(flowStep.getComponent());
    }
  }
  save((AbstractObject)flow);
}
Program: 167490
Project: 167490
Buggy source:
@Override public void refresh(ModelAttributeRelationship modelAttributeRelationship){
  refresh((AbstractObject)modelAttributeRelationship);
}

Fixed version (ground truth):
@Override public void refresh(ModelAttribute modelAttribute){
  refresh((AbstractObject)modelAttribute);
}
Program: 167493
Project: 167493
Buggy source:
@Override public void call(JsonArray arguments){
  if (arguments.length() > 0) {
    Object obj=arguments.get(0);
    if (obj instanceof JsonObject) {
      JsonObject json=arguments.getObject(0);
      String sourceNodeId=json.getString("String_Node_Str");
      String targetNodeId=json.getString("String_Node_Str");
      boolean removed=json.getBoolean("String_Node_Str");
      DiagramState state=getState();
      for (      Node node : state.nodes) {
        if (node.getId().equals(sourceNodeId)) {
          if (!removed && !node.getTargetNodeIds().contains(targetNodeId)) {
            node.getTargetNodeIds().add(targetNodeId);
          }
 else           if (removed) {
            node.getTargetNodeIds().remove(targetNodeId);
          }
          fireEvent(new LinkEvent(Diagram.this,sourceNodeId,targetNodeId,removed));
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void call(JsonArray arguments){
  if (arguments.length() > 0) {
    Object obj=arguments.get(0);
    if (obj instanceof JsonObject) {
      JsonObject json=arguments.getObject(0);
      String sourceNodeId=json.getString("String_Node_Str");
      String targetNodeId=json.getString("String_Node_Str");
      String origSourceNodeId=json.getString("String_Node_Str");
      String origTargetNodeId=json.getString("String_Node_Str");
      DiagramState state=getState();
      for (      Node node : state.nodes) {
        if (node.getId().equals(sourceNodeId)) {
          if (!node.getTargetNodeIds().contains(targetNodeId)) {
            node.getTargetNodeIds().add(targetNodeId);
          }
          fireEvent(new LinkEvent(Diagram.this,sourceNodeId,targetNodeId,false));
          break;
        }
      }
      for (      Node node : state.nodes) {
        if (node.getId().equals(origSourceNodeId)) {
          node.getTargetNodeIds().remove(origTargetNodeId);
          fireEvent(new LinkEvent(Diagram.this,origSourceNodeId,origTargetNodeId,true));
          break;
        }
      }
    }
  }
}
Program: 167495
Project: 167495
Buggy source:
private EntityData processInputRow(String inputRow) throws IOException {
  CsvReader csvReader=new CsvReader(new ByteArrayInputStream(inputRow.getBytes()),Charset.forName(encoding));
  csvReader.setDelimiter(delimiter.charAt(0));
  if (isNotBlank(quoteCharacter)) {
    csvReader.setTextQualifier(quoteCharacter.charAt(0));
    csvReader.setUseTextQualifier(true);
  }
  if (csvReader.readRecord()) {
    EntityData data=new EntityData();
    if (attributes.size() > 0) {
      for (      AttributeFormat attribute : attributes) {
        Object value=csvReader.get(attribute.getOrdinal());
        if (isNotBlank(attribute.getFormatFunction())) {
          value=ModelAttributeScriptHelper.eval(attribute.getAttribute(),value,attribute.getEntity(),data,attribute.getFormatFunction());
        }
        data.put(attribute.getAttributeId(),value);
      }
    }
 else {
      Model model=flowStep.getComponent().getOutputModel();
      List<ModelEntity> entities=model.getModelEntities();
      int index=0;
      for (      ModelEntity modelEntity : entities) {
        List<ModelAttribute> attributes=modelEntity.getModelAttributes();
        for (        ModelAttribute modelAttribute : attributes) {
          data.put(modelAttribute.getId(),csvReader.get(index));
        }
      }
    }
    return data;
  }
  return null;
}

Fixed version (ground truth):
private EntityData processInputRow(String inputRow) throws IOException {
  CsvReader csvReader=new CsvReader(new ByteArrayInputStream(inputRow.getBytes()),Charset.forName(encoding));
  csvReader.setDelimiter(delimiter.charAt(0));
  if (isNotBlank(quoteCharacter)) {
    csvReader.setTextQualifier(quoteCharacter.charAt(0));
    csvReader.setUseTextQualifier(true);
  }
  if (csvReader.readRecord()) {
    EntityData data=new EntityData();
    if (attributes.size() > 0) {
      for (      AttributeFormat attribute : attributes) {
        Object value=csvReader.get(attribute.getOrdinal() - 1);
        if (isNotBlank(attribute.getFormatFunction())) {
          value=ModelAttributeScriptHelper.eval(attribute.getAttribute(),value,attribute.getEntity(),data,attribute.getFormatFunction());
        }
        data.put(attribute.getAttributeId(),value);
      }
    }
 else {
      Model model=flowStep.getComponent().getOutputModel();
      List<ModelEntity> entities=model.getModelEntities();
      int index=0;
      for (      ModelEntity modelEntity : entities) {
        List<ModelAttribute> attributes=modelEntity.getModelAttributes();
        for (        ModelAttribute modelAttribute : attributes) {
          data.put(modelAttribute.getId(),csvReader.get(index));
        }
      }
    }
    return data;
  }
  return null;
}
Program: 167496
Project: 167496
Buggy source:
public FlowStepLink removeFlowStepLink(String sourceStepId,String targetStepId){
  FlowStepLink link=null;
  Iterator<FlowStepLink> i=flowStepLinks.iterator();
  while (i.hasNext()) {
    link=i.next();
    if (link.getSourceStepId().equals(sourceStepId) && link.getTargetStepId().equals(targetStepId)) {
      i.remove();
    }
  }
  return link;
}

Fixed version (ground truth):
public FlowStepLink removeFlowStepLink(String sourceStepId,String targetStepId){
  FlowStepLink link=null;
  Iterator<FlowStepLink> i=flowStepLinks.iterator();
  while (i.hasNext()) {
    link=i.next();
    if (link.getSourceStepId().equals(sourceStepId) && link.getTargetStepId().equals(targetStepId)) {
      i.remove();
      break;
    }
  }
  return link;
}
Program: 167497
Project: 167497
Buggy source:
@Override public void start(String executionId,IExecutionTracker executionTracker){
  super.start(executionId,executionTracker);
  error=null;
  if (resource == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TypedProperties properties=flowStep.getComponent().toTypedProperties(getSettingDefinitions(false));
  replaceRows=properties.is(REPLACE);
  updateFirst=properties.is(UPDATE_FIRST);
  insertFallback=properties.is(INSERT_FALLBACK);
  quoteIdentifiers=properties.is(QUOTE_IDENTIFIERS);
  stopProcessingOnError=properties.is(STOP_PROCESSING_ON_ERROR,true);
  fitToColumn=properties.is(FIT_TO_COLUMN);
  DataSource dataSource=(DataSource)resource.reference();
  platform=JdbcDatabasePlatformFactory.createNewPlatformInstance(dataSource,new SqlTemplateSettings(),quoteIdentifiers);
  targetTables=new ArrayList<TargetTableDefintion>();
  for (  ModelEntity entity : flowStep.getComponent().getInputModel().getModelEntities()) {
    Table table=platform.getTableFromCache(entity.getName(),true);
    if (table != null) {
      targetTables.add(new TargetTableDefintion(entity,new TargetTable(DmlType.UPDATE,entity,table.copy()),new TargetTable(DmlType.INSERT,entity,table.copy())));
    }
  }
}

Fixed version (ground truth):
@Override public void start(String executionId,IExecutionTracker executionTracker){
  super.start(executionId,executionTracker);
  error=null;
  if (resource == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  Model model=flowStep.getComponent().getInputModel();
  if (model == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TypedProperties properties=flowStep.getComponent().toTypedProperties(getSettingDefinitions(false));
  replaceRows=properties.is(REPLACE);
  updateFirst=properties.is(UPDATE_FIRST);
  insertFallback=properties.is(INSERT_FALLBACK);
  quoteIdentifiers=properties.is(QUOTE_IDENTIFIERS);
  stopProcessingOnError=properties.is(STOP_PROCESSING_ON_ERROR,true);
  fitToColumn=properties.is(FIT_TO_COLUMN);
  DataSource dataSource=(DataSource)resource.reference();
  platform=JdbcDatabasePlatformFactory.createNewPlatformInstance(dataSource,new SqlTemplateSettings(),quoteIdentifiers);
  targetTables=new ArrayList<TargetTableDefintion>();
  for (  ModelEntity entity : model.getModelEntities()) {
    Table table=platform.getTableFromCache(entity.getName(),true);
    if (table != null) {
      targetTables.add(new TargetTableDefintion(entity,new TargetTable(DmlType.UPDATE,entity,table.copy()),new TargetTable(DmlType.INSERT,entity,table.copy())));
    }
  }
}
Program: 167501
Project: 167501
Buggy source:
private void applySettings(){
  Component component=flowStep.getComponent();
  relativePathAndFile=component.get(SETTING_RELATIVE_PATH,relativePathAndFile);
  mustExist=component.getBoolean(SETTING_MUST_EXIST,mustExist);
  textRowsPerMessage=component.getInt(SETTING_ROWS_PER_MESSAGE,textRowsPerMessage);
  textHeaderLinesToSkip=component.getInt(SETTING_HEADER_LINES_TO_SKIP,textHeaderLinesToSkip);
  getFileNameFromMessage=component.getBoolean(SETTING_GET_FILE_FROM_MESSAGE,getFileNameFromMessage);
  deleteOnComplete=component.getBoolean(SETTING_DELETE_ON_COMPLETE,deleteOnComplete);
  encoding=component.get(SETTING_ENCODING,encoding);
}

Fixed version (ground truth):
private void applySettings(){
  Component component=flowStep.getComponent();
  relativePathAndFile=component.get(SETTING_RELATIVE_PATH,relativePathAndFile);
  mustExist=component.getBoolean(SETTING_MUST_EXIST,mustExist);
  textRowsPerMessage=component.getInt(SETTING_ROWS_PER_MESSAGE,textRowsPerMessage);
  textHeaderLinesToSkip=component.getInt(SETTING_HEADER_LINES_TO_SKIP,textHeaderLinesToSkip);
  textRowsPerMessage=component.getInt(SETTING_ROWS_PER_MESSAGE,textRowsPerMessage);
  getFileNameFromMessage=component.getBoolean(SETTING_GET_FILE_FROM_MESSAGE,getFileNameFromMessage);
  deleteOnComplete=component.getBoolean(SETTING_DELETE_ON_COMPLETE,deleteOnComplete);
  encoding=component.get(SETTING_ENCODING,encoding);
}
Program: 167502
Project: 167502
Buggy source:
private void convertAttributeSettingsToAttributeFormat(){
  List<ComponentAttributeSetting> attributeSettings=flowStep.getComponent().getAttributeSettings();
  Map<String,AttributeFormat> formats=new HashMap<String,DelimitedParser.AttributeFormat>();
  for (  ComponentAttributeSetting attributeSetting : attributeSettings) {
    AttributeFormat format=formats.get(attributeSetting.getAttributeId());
    if (format == null) {
      Model inputModel=flowStep.getComponent().getInputModel();
      ModelAttribute attribute=inputModel.getAttributeById(attributeSetting.getAttributeId());
      ModelEntity entity=inputModel.getEntityById(attribute.getEntityId());
      format=new AttributeFormat(attributeSetting.getAttributeId(),entity,attribute);
      formats.put(attributeSetting.getAttributeId(),format);
    }
    if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_ORDINAL)) {
      format.setOrdinal(Integer.parseInt(attributeSetting.getValue()));
    }
 else     if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_FORMAT_FUNCTION)) {
      format.setFormatFunction(attributeSetting.getValue());
    }
  }
  attributes.addAll(formats.values());
  Collections.sort(attributes,new Comparator<AttributeFormat>(){
    @Override public int compare(    AttributeFormat ordinal1,    AttributeFormat ordinal2){
      return ordinal1.getOrdinal() - ordinal2.getOrdinal();
    }
  }
);
}

Fixed version (ground truth):
private void convertAttributeSettingsToAttributeFormat(){
  List<ComponentAttributeSetting> attributeSettings=flowStep.getComponent().getAttributeSettings();
  Map<String,AttributeFormat> formats=new HashMap<String,DelimitedParser.AttributeFormat>();
  for (  ComponentAttributeSetting attributeSetting : attributeSettings) {
    AttributeFormat format=formats.get(attributeSetting.getAttributeId());
    if (format == null) {
      Model inputModel=flowStep.getComponent().getOutputModel();
      ModelAttribute attribute=inputModel.getAttributeById(attributeSetting.getAttributeId());
      ModelEntity entity=inputModel.getEntityById(attribute.getEntityId());
      format=new AttributeFormat(attributeSetting.getAttributeId(),entity,attribute);
      formats.put(attributeSetting.getAttributeId(),format);
    }
    if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_ORDINAL)) {
      format.setOrdinal(Integer.parseInt(attributeSetting.getValue()));
    }
 else     if (attributeSetting.getName().equalsIgnoreCase(DELIMITED_FORMATTER_ATTRIBUTE_FORMAT_FUNCTION)) {
      format.setFormatFunction(attributeSetting.getValue());
    }
  }
  attributes.addAll(formats.values());
  Collections.sort(attributes,new Comparator<AttributeFormat>(){
    @Override public int compare(    AttributeFormat ordinal1,    AttributeFormat ordinal2){
      return ordinal1.getOrdinal() - ordinal2.getOrdinal();
    }
  }
);
}
Program: 167503
Project: 167503
Buggy source:
@Override public void run(){
synchronized (AgentRuntime.this) {
    configurationService.refresh(agent);
    for (    AgentDeployment deployment : agent.getAgentDeployments()) {
      DeploymentStatus status=deployment.getDeploymentStatus();
      if (status.equals(DeploymentStatus.REQUEST_DEPLOY)) {
        deploy(deployment);
      }
 else       if (status.equals(DeploymentStatus.REQUEST_UNDEPLOY)) {
        undeploy(deployment);
      }
 else       if (status.equals(DeploymentStatus.REQUEST_DISABLE)) {
        stop(deployment);
        deployment.setStatus(DeploymentStatus.DISABLED.name());
        configurationService.save(deployment);
      }
 else {
        deployResources(deployment.getFlow());
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
synchronized (AgentRuntime.this) {
    configurationService.refresh(agent);
    for (    AgentDeployment deployment : new HashSet<AgentDeployment>(agent.getAgentDeployments())) {
      DeploymentStatus status=deployment.getDeploymentStatus();
      if (status.equals(DeploymentStatus.REQUEST_DEPLOY)) {
        deploy(deployment);
      }
 else       if (status.equals(DeploymentStatus.REQUEST_UNDEPLOY)) {
        undeploy(deployment);
      }
 else       if (status.equals(DeploymentStatus.REQUEST_DISABLE)) {
        stop(deployment);
        deployment.setStatus(DeploymentStatus.DISABLED.name());
        configurationService.save(deployment);
      }
 else {
        deployResources(deployment.getFlow());
      }
    }
  }
}
Program: 167504
Project: 167504
Buggy source:
@Override public void beforeFlow(String executionId){
  super.beforeFlow(executionId);
  this.steps=new HashMap<String,ExecutionStep>();
  execution=new Execution();
  execution.setId(executionId);
  execution.setStartTime(new Date());
  execution.setStatus(ExecutionStatus.RUNNING.name());
  execution.setAgentId(deployment.getAgentId());
  execution.setFlowId(deployment.getFlowId());
  execution.setAgentName(agent.getName());
  execution.setFlowName(deployment.getFlow().getName());
  this.recorder.record(execution);
}

Fixed version (ground truth):
@Override public void beforeFlow(String executionId){
  super.beforeFlow(executionId);
  this.steps=new HashMap<String,ExecutionStep>();
  execution=new Execution();
  execution.setId(executionId);
  execution.setStartTime(new Date());
  execution.setStatus(ExecutionStatus.RUNNING.name());
  execution.setAgentId(deployment.getAgentId());
  execution.setFlowId(deployment.getFlowId());
  execution.setAgentName(agent.getName());
  execution.setFlowName(deployment.getName());
  this.recorder.record(execution);
}
Program: 167505
Project: 167505
Buggy source:
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  componentStatistics.incrementInboundMessages();
  if (inputMessage.getHeader().getOriginatingStepId().equals(sourceStepId)) {
    List<EntityData> datas=inputMessage.getPayload();
    multipliers.addAll(datas);
    multipliersInitialized=inputMessage.getHeader().isLastMessage();
  }
 else   if (!multipliersInitialized) {
    queuedWhileWaitingForMultiplier.add(inputMessage);
  }
  if (multipliersInitialized) {
    Iterator<Message> messages=queuedWhileWaitingForMultiplier.iterator();
    while (messages.hasNext()) {
      Message message=messages.next();
      multiply(message,messageTarget);
    }
    multiply(inputMessage,messageTarget);
  }
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  componentStatistics.incrementInboundMessages();
  if (inputMessage.getHeader().getOriginatingStepId().equals(sourceStepId)) {
    List<EntityData> datas=inputMessage.getPayload();
    multipliers.addAll(datas);
    multipliersInitialized=inputMessage.getHeader().isLastMessage();
    Iterator<Message> messages=queuedWhileWaitingForMultiplier.iterator();
    while (messages.hasNext()) {
      Message message=messages.next();
      multiply(message,messageTarget);
    }
  }
 else   if (!multipliersInitialized) {
    queuedWhileWaitingForMultiplier.add(inputMessage);
  }
 else   if (multipliersInitialized) {
    multiply(inputMessage,messageTarget);
  }
}
Program: 167506
Project: 167506
Buggy source:
public AgentDeploymentParameter(String name,String value,String agentDeploymentId){
  this.name=name;
  this.value=value;
  this.agentDeploymentId=agentDeploymentId;
}

Fixed version (ground truth):
public AgentDeploymentParameter(String name,String value,String agentDeploymentId,String flowParameterId){
  this.name=name;
  this.value=value;
  this.agentDeploymentId=agentDeploymentId;
  this.flowParameterId=flowParameterId;
}
Program: 167508
Project: 167508
Buggy source:
protected void refreshAgentDeployments(Agent agent){
  Map<String,Object> settingParams=new HashMap<String,Object>();
  settingParams.put("String_Node_Str",agent.getId());
  List<AgentDeployment> deployments=persistenceManager.find(AgentDeployment.class,settingParams,null,null,tableName(AgentDeployment.class));
  for (  AgentDeployment agentDeployment : deployments) {
    refreshAgentDeploymentRelations(agentDeployment);
    refresh(agentDeployment.getFlow());
    agent.getAgentDeployments().add(agentDeployment);
  }
}

Fixed version (ground truth):
protected void refreshAgentDeployments(Agent agent){
  Map<String,Object> settingParams=new HashMap<String,Object>();
  settingParams.put("String_Node_Str",agent.getId());
  List<AgentDeployment> deployments=persistenceManager.find(AgentDeployment.class,settingParams,null,null,tableName(AgentDeployment.class));
  agent.setAgentDeployments(deployments);
  for (  AgentDeployment agentDeployment : deployments) {
    refreshAgentDeploymentRelations(agentDeployment);
    refresh(agentDeployment.getFlow());
  }
}
Program: 167509
Project: 167509
Buggy source:
@Override public void flowStepFinished(String executionId,IComponent component,Throwable error,boolean cancelled){
  super.flowStepFinished(executionId,component,error,cancelled);
  ExecutionStep step=steps.get(component.getFlowStep().getId());
  step.setEndTime(new Date());
  ExecutionStatus status=ExecutionStatus.DONE;
  if (error != null) {
    status=ExecutionStatus.ERROR;
  }
  if (cancelled) {
    status=ExecutionStatus.CANCELLED;
  }
  step.setStatus(status.name());
  if (component.getComponentStatistics() != null) {
    step.setMessagesReceived(component.getComponentStatistics().getNumberInboundMessages());
    step.setMessagesProduced(component.getComponentStatistics().getNumberOutboundMessages());
  }
  this.recorder.record(step);
}

Fixed version (ground truth):
@Override public void flowStepFinished(String executionId,IComponent component,Throwable error,boolean cancelled){
  super.flowStepFinished(executionId,component,error,cancelled);
  ExecutionStep step=steps.get(component.getFlowStep().getId());
  if (step != null) {
    step.setEndTime(new Date());
    ExecutionStatus status=ExecutionStatus.DONE;
    if (error != null) {
      status=ExecutionStatus.ERROR;
    }
    if (cancelled) {
      status=ExecutionStatus.CANCELLED;
    }
    step.setStatus(status.name());
    if (component.getComponentStatistics() != null) {
      step.setMessagesReceived(component.getComponentStatistics().getNumberInboundMessages());
      step.setMessagesProduced(component.getComponentStatistics().getNumberOutboundMessages());
    }
    this.recorder.record(step);
  }
}
Program: 167510
Project: 167510
Buggy source:
@Override public void start(String executionId,IExecutionTracker executionTracker){
  super.start(executionId,executionTracker);
  error=null;
  TypedProperties properties=flowStep.getComponent().toTypedProperties(getSettingDefinitions(false));
  replaceRows=properties.is(REPLACE);
  updateFirst=properties.is(UPDATE_FIRST);
  insertFallback=properties.is(INSERT_FALLBACK);
  quoteIdentifiers=properties.is(QUOTE_IDENTIFIERS);
  stopProcessingOnError=properties.is(STOP_PROCESSING_ON_ERROR,true);
  fitToColumn=properties.is(FIT_TO_COLUMN);
  DataSource dataSource=(DataSource)resource.reference();
  platform=JdbcDatabasePlatformFactory.createNewPlatformInstance(dataSource,new SqlTemplateSettings(),quoteIdentifiers);
  targetTables=new ArrayList<TargetTableDefintion>();
  for (  ModelEntity entity : flowStep.getComponent().getInputModel().getModelEntities()) {
    Table table=platform.getTableFromCache(entity.getName(),true);
    if (table != null) {
      targetTables.add(new TargetTableDefintion(entity,new TargetTable(DmlType.UPDATE,entity,table.copy()),new TargetTable(DmlType.INSERT,entity,table.copy())));
    }
  }
}

Fixed version (ground truth):
@Override public void start(String executionId,IExecutionTracker executionTracker){
  super.start(executionId,executionTracker);
  error=null;
  if (resource == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  TypedProperties properties=flowStep.getComponent().toTypedProperties(getSettingDefinitions(false));
  replaceRows=properties.is(REPLACE);
  updateFirst=properties.is(UPDATE_FIRST);
  insertFallback=properties.is(INSERT_FALLBACK);
  quoteIdentifiers=properties.is(QUOTE_IDENTIFIERS);
  stopProcessingOnError=properties.is(STOP_PROCESSING_ON_ERROR,true);
  fitToColumn=properties.is(FIT_TO_COLUMN);
  DataSource dataSource=(DataSource)resource.reference();
  platform=JdbcDatabasePlatformFactory.createNewPlatformInstance(dataSource,new SqlTemplateSettings(),quoteIdentifiers);
  targetTables=new ArrayList<TargetTableDefintion>();
  for (  ModelEntity entity : flowStep.getComponent().getInputModel().getModelEntities()) {
    Table table=platform.getTableFromCache(entity.getName(),true);
    if (table != null) {
      targetTables.add(new TargetTableDefintion(entity,new TargetTable(DmlType.UPDATE,entity,table.copy()),new TargetTable(DmlType.INSERT,entity,table.copy())));
    }
  }
}
Program: 167511
Project: 167511
Buggy source:
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  this.executionId=executionId;
  componentStatistics.incrementInboundMessages();
  if (this.resource == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (inputMessage.getHeader().getSequenceNumber() == 1) {
    initStreamAndWriter();
  }
  ArrayList<String> recs=inputMessage.getPayload();
  try {
    for (    String rec : recs) {
      bufferedWriter.write(rec);
      if (StringUtils.isNotBlank(lineTerminator)) {
        bufferedWriter.write(TEXTFILEWRITER_TEXT_LINE_TERMINATOR);
      }
 else {
        bufferedWriter.newLine();
      }
    }
    bufferedWriter.flush();
  }
 catch (  IOException e) {
    throw new IoException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,IMessageTarget messageTarget){
  componentStatistics.incrementInboundMessages();
  if (this.resource == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (inputMessage.getHeader().getSequenceNumber() == 1) {
    initStreamAndWriter();
  }
  ArrayList<String> recs=inputMessage.getPayload();
  try {
    for (    String rec : recs) {
      bufferedWriter.write(rec);
      if (StringUtils.isNotBlank(lineTerminator)) {
        bufferedWriter.write(TEXTFILEWRITER_TEXT_LINE_TERMINATOR);
      }
 else {
        bufferedWriter.newLine();
      }
    }
    bufferedWriter.flush();
  }
 catch (  IOException e) {
    throw new IoException("String_Node_Str" + e.getMessage());
  }
}
Program: 167513
Project: 167513
Buggy source:
protected void finishEditingItem(){
  if (itemBeingEdited != null) {
    IConfigurationService configurationService=context.getConfigurationService();
    treeTable.addShortcutListener(treeTableDeleteKeyShortcutListener);
    Object selected=itemBeingEdited;
    Method method=null;
    try {
      method=configurationService.getClass().getMethod("String_Node_Str",itemBeingEdited.getClass());
    }
 catch (    NoSuchMethodException e) {
    }
catch (    SecurityException e) {
    }
    if (method != null) {
      try {
        method.invoke(configurationService,itemBeingEdited);
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
    }
 else {
      configurationService.save(itemBeingEdited);
    }
    itemBeingEdited=null;
    treeTable.refreshRowCache();
    treeTable.focus();
    treeTable.setValue(selected);
  }
}

Fixed version (ground truth):
protected void finishEditingItem(){
  if (itemBeingEdited != null) {
    IConfigurationService configurationService=context.getConfigurationService();
    treeTable.addShortcutListener(treeTableDeleteKeyShortcutListener);
    Object selected=itemBeingEdited;
    Method method=null;
    try {
      method=configurationService.getClass().getMethod("String_Node_Str",itemBeingEdited.getClass());
    }
 catch (    NoSuchMethodException e) {
    }
catch (    SecurityException e) {
    }
    if (method != null) {
      try {
        method.invoke(configurationService,itemBeingEdited);
      }
 catch (      Exception e) {
        throw new RuntimeException(e);
      }
    }
 else {
      configurationService.save(itemBeingEdited);
    }
    itemBeingEdited=null;
    treeTable.refreshRowCache();
    treeTable.focus();
    treeTable.setValue(selected);
    selectionChanged();
  }
}
Program: 167514
Project: 167514
Buggy source:
@Override public void valueChange(ValueChangeEvent event){
  selectionChanged(event);
}

Fixed version (ground truth):
@Override public void valueChange(ValueChangeEvent event){
  selectionChanged();
}
Program: 167515
Project: 167515
Buggy source:
protected void selectionChanged(ValueChangeEvent event){
  setMenuItemsEnabled();
  updatePropertySheet();
  treeTable.removeShortcutListener(treeTableEnterKeyShortcutListener);
  if (treeTable.getValue() != null) {
    treeTable.addShortcutListener(treeTableEnterKeyShortcutListener);
  }
}

Fixed version (ground truth):
protected void selectionChanged(){
  setMenuItemsEnabled();
  updatePropertySheet();
  treeTable.removeShortcutListener(treeTableEnterKeyShortcutListener);
  if (treeTable.getValue() != null) {
    treeTable.addShortcutListener(treeTableEnterKeyShortcutListener);
  }
}
Program: 167517
Project: 167517
Buggy source:
@Override public void componentNameChanged(Component component){
  selected(EditFlowPanel.this.flow.findFlowStepWithComponentId(component.getId()));
}

Fixed version (ground truth):
@Override public void componentNameChanged(Component component){
  refreshStepOnDiagram(EditFlowPanel.this.flow.findFlowStepWithComponentId(component.getId()));
}
Program: 167518
Project: 167518
Buggy source:
public void selected(FlowStep step){
  if (step != null) {
    step=flow.findFlowStepWithId(step.getId());
  }
  if (step != null) {
    context.getConfigurationService().refresh(step.getComponent());
    diagram.setNodes(getNodes());
    diagram.setSelectedNodeId(step.getId());
    propertySheet.valueChange(step);
  }
 else {
    diagram.setSelectedNodeId(null);
    propertySheet.valueChange((Object)null);
  }
}

Fixed version (ground truth):
public void selected(FlowStep step){
  if (step != null) {
    step=flow.findFlowStepWithId(step.getId());
  }
  if (step != null) {
    refreshStepOnDiagram(step);
    propertySheet.valueChange(step);
  }
 else {
    diagram.setSelectedNodeId(null);
    propertySheet.valueChange((Object)null);
  }
}
Program: 167519
Project: 167519
Buggy source:
public Message copy(String originatingStepId){
  try {
    Message message=(Message)this.clone();
    message.header=header.copy();
    message.header.setOriginatingStepId(originatingStepId);
    return message;
  }
 catch (  CloneNotSupportedException e) {
    throw new InternalError();
  }
}

Fixed version (ground truth):
public Message copy(String originatingStepId,Serializable newPayload){
  try {
    Message message=(Message)this.clone();
    message.header=header.copy();
    message.header.setOriginatingStepId(originatingStepId);
    message.setPayload(newPayload);
    return message;
  }
 catch (  CloneNotSupportedException e) {
    throw new InternalError();
  }
}
Program: 167520
Project: 167520
Buggy source:
private void open(){
  IStreamableResource resource=(IStreamableResource)this.resource.reference();
  resource.appendPath(relativePathAndFile,mustExist);
  inStream=resource.getInputStream();
}

Fixed version (ground truth):
private void open(){
  IStreamableResource resource=(IStreamableResource)this.resource.reference();
  inStream=resource.getInputStream(relativePathAndFile,mustExist);
}