nus-yam/ex-repair huggingface dataset:
Program: 167359
Project: 167359
Buggy source:
protected void massageValues(Map<String,AbstractObject> oldToNewUUIDMapping,List<? extends Setting> settings){
  for (  Setting setting : settings) {
    setting.setValue(FormatUtils.replaceTokens(setting.getValue(),toStringTokens(oldToNewUUIDMapping),false));
  }
}

Fixed version (ground truth):
protected void massageValues(Map<String,AbstractObject> oldToNewUUIDMapping,List<? extends Setting> settings){
  Map<String,String> tokens=toStringTokens(oldToNewUUIDMapping);
  for (  Setting setting : settings) {
    boolean printafter=false;
    if (setting.getValue() != null && setting.getValue().contains("String_Node_Str")) {
      System.out.println("String_Node_Str" + setting.getValue());
      printafter=true;
    }
    setting.setValue(FormatUtils.replaceTokens(setting.getValue(),tokens,false));
    if (printafter) {
      System.out.println("String_Node_Str" + setting.getValue());
    }
  }
}
Program: 167360
Project: 167360
Buggy source:
protected void buildUI(){
  if (!readOnly) {
    ButtonBar buttonBar=new ButtonBar();
    addComponent(buttonBar);
    addButton=buttonBar.addButton("String_Node_Str",FontAwesome.PLUS);
    addButton.addClickListener((event) -> table.addItem(new Route()));
    removeButton=buttonBar.addButton("String_Node_Str",FontAwesome.TRASH_O);
    removeButton.addClickListener((event) -> {
      if (table.getValue() != null) {
        table.removeItem(table.getValue());
        save();
      }
    }
);
  }
  table.setContainerDataSource(container);
  table.setSelectable(true);
  table.setSortEnabled(false);
  table.setImmediate(true);
  table.setSizeFull();
  table.setVisibleColumns(new Object[]{"String_Node_Str","String_Node_Str"});
  table.setColumnHeaders(new String[]{"String_Node_Str","String_Node_Str"});
  table.setTableFieldFactory(new EditFieldFactory());
  table.addItemClickListener((event) -> {
    if (table.getValue() != null) {
      table.setValue(null);
    }
  }
);
  if (!readOnly) {
    table.addValueChangeListener((event) -> removeButton.setEnabled(table.getValue() != null));
    table.setEditable(true);
  }
  addComponent(table);
  setExpandRatio(table,1.0f);
  String json=flowStep.getComponent().get(ContentRouter.SETTING_CONFIG);
  if (isNotBlank(json)) {
    try {
      List<Route> routes=new ObjectMapper().readValue(json,new TypeReference<List<Route>>(){
      }
);
      for (      Route route : routes) {
        table.addItem(route);
      }
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
protected void buildUI(){
  if (!readOnly) {
    ButtonBar buttonBar=new ButtonBar();
    addComponent(buttonBar);
    addButton=buttonBar.addButton("String_Node_Str",FontAwesome.PLUS);
    addButton.addClickListener((event) -> table.addItem(new Route()));
    removeButton=buttonBar.addButton("String_Node_Str",FontAwesome.TRASH_O);
    removeButton.addClickListener((event) -> {
      if (table.getValue() != null) {
        table.removeItem(table.getValue());
        save();
      }
    }
);
  }
  table.setContainerDataSource(container);
  table.setSelectable(true);
  table.setSortEnabled(false);
  table.setImmediate(true);
  table.setSizeFull();
  table.setVisibleColumns(new Object[]{"String_Node_Str","String_Node_Str"});
  table.setColumnHeaders(new String[]{"String_Node_Str","String_Node_Str"});
  table.setTableFieldFactory(new EditFieldFactory());
  table.addItemClickListener((event) -> {
    if (table.getValue() != null) {
      table.setValue(null);
    }
  }
);
  table.setEditable(true);
  if (!readOnly) {
    table.addValueChangeListener((event) -> removeButton.setEnabled(table.getValue() != null));
  }
  addComponent(table);
  setExpandRatio(table,1.0f);
  String json=flowStep.getComponent().get(ContentRouter.SETTING_CONFIG);
  if (isNotBlank(json)) {
    try {
      List<Route> routes=new ObjectMapper().readValue(json,new TypeReference<List<Route>>(){
      }
);
      for (      Route route : routes) {
        table.addItem(route);
      }
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 167362
Project: 167362
Buggy source:
/** 
 * Open and connect a reusable SFTP channel.
 * @param channelId is the ID of the reusable channel to open.
 * @return a connected reusable channel.
 * @throws JSchException
 */
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  Map<Integer,ChannelSftp> channels=threadChannels.get();
  if (channels == null) {
    channels=new HashMap<Integer,ChannelSftp>();
  }
  ChannelSftp channel=channels.get(channelId);
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  channels.put(channelId,channel);
  threadChannels.set(channels);
  return channel;
}

Fixed version (ground truth):
/** 
 * Open and connect a reusable SFTP channel.
 * @param channelId is the ID of the reusable channel to open.
 * @return a connected reusable channel.
 */
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  Map<Integer,ChannelSftp> channels=threadChannels.get();
  if (channels == null) {
    channels=new HashMap<Integer,ChannelSftp>();
  }
  ChannelSftp channel=channels.get(channelId);
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  channels.put(channelId,channel);
  threadChannels.set(channels);
  return channel;
}
Program: 167363
Project: 167363
Buggy source:
@Override public void copyFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp uploadSftp=null;
  InputStream inputStream=null;
  try {
    uploadSftp=openConnectedChannel(CHANNEL_1);
    uploadSftp.cd(basePath);
    inputStream=getInputStream(fromFilePath,true);
    uploadSftp.put(inputStream,toFilePath);
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public void copyFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp uploadSftp=null;
  InputStream inputStream=null;
  try {
    uploadSftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    uploadSftp.cd(basePath);
    inputStream=getInputStream(fromFilePath,true);
    uploadSftp.put(inputStream,toFilePath);
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167364
Project: 167364
Buggy source:
@Override public boolean delete(String relativePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rm(relativePath);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public boolean delete(String relativePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rm(relativePath);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167365
Project: 167365
Buggy source:
@Override public void moveToDir(String fromFilePath,String toDirPath,boolean closeSession){
  ChannelSftp sftp=null;
  FileInfo fileInfo=new FileInfo(fromFilePath,false,new java.util.Date().getTime(),-1);
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    if (!toDirPath.endsWith("String_Node_Str")) {
      toDirPath+="String_Node_Str";
    }
    sftp.rename(fromFilePath,toDirPath + fileInfo.getName());
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public void moveToDir(String fromFilePath,String toDirPath,boolean closeSession){
  ChannelSftp sftp=null;
  FileInfo fileInfo=new FileInfo(fromFilePath,false,new java.util.Date().getTime(),-1);
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    if (!toDirPath.endsWith("String_Node_Str")) {
      toDirPath+="String_Node_Str";
    }
    sftp.rename(fromFilePath,toDirPath + fileInfo.getName());
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167366
Project: 167366
Buggy source:
@Override public FileInfo listFile(String relativePath,boolean closeSession){
  ChannelSftp sftp=null;
  FileInfo fileInfo=null;
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
      @SuppressWarnings("String_Node_Str") Vector list=sftp.ls(relativePath);
      for (      Object object : list) {
        LsEntry entry=(LsEntry)object;
        if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
          fileInfo=new FileInfo(relativePath,entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize());
        }
      }
    }
    return fileInfo;
  }
 catch (  Exception e) {
    return null;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public FileInfo listFile(String relativePath,boolean closeSession){
  ChannelSftp sftp=null;
  FileInfo fileInfo=null;
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
      @SuppressWarnings("String_Node_Str") Vector list=sftp.ls(relativePath);
      for (      Object object : list) {
        LsEntry entry=(LsEntry)object;
        if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
          fileInfo=new FileInfo(relativePath,entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize());
        }
      }
    }
    return fileInfo;
  }
 catch (  Exception e) {
    return null;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167367
Project: 167367
Buggy source:
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  Map<Integer,ChannelSftp> channels=threadChannels.get();
  if (channels == null) {
    channels=new HashMap<Integer,ChannelSftp>();
  }
  ChannelSftp channel=channels.get(channelId);
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  channels.put(channelId,channel);
  threadChannels.set(channels);
  return channel;
}

Fixed version (ground truth):
/** 
 * Open and connect a reusable SFTP channel.
 * @param channelId is the ID of the reusable channel to open.
 * @return a connected reusable channel.
 * @throws JSchException
 */
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  Map<Integer,ChannelSftp> channels=threadChannels.get();
  if (channels == null) {
    channels=new HashMap<Integer,ChannelSftp>();
  }
  ChannelSftp channel=channels.get(channelId);
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  channels.put(channelId,channel);
  threadChannels.set(channels);
  return channel;
}
Program: 167368
Project: 167368
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public List<FileInfo> listFiles(boolean closeSession,String... relativePaths){
  ChannelSftp sftp=null;
  String separator=null;
  List<FileInfo> fileInfoList=new ArrayList<>();
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    for (    String relativePath : relativePaths) {
      if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
        if (relativePath.isEmpty() || StringUtils.endsWith(relativePath,"String_Node_Str")) {
          separator="String_Node_Str";
        }
 else {
          separator="String_Node_Str";
        }
        Vector list=new Vector();
        try {
          list.addAll(sftp.ls(relativePath.isEmpty() ? "String_Node_Str" : relativePath));
        }
 catch (        SftpException e) {
          log.warn("String_Node_Str" + e.getMessage());
        }
        for (        Object object : list) {
          LsEntry entry=(LsEntry)object;
          if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
            fileInfoList.add(new FileInfo(relativePath + separator + entry.getFilename(),entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize()));
          }
        }
      }
    }
    return fileInfoList;
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",e.getMessage()),e);
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public List<FileInfo> listFiles(boolean closeSession,String... relativePaths){
  ChannelSftp sftp=null;
  String separator=null;
  List<FileInfo> fileInfoList=new ArrayList<>();
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    for (    String relativePath : relativePaths) {
      if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
        if (relativePath.isEmpty() || StringUtils.endsWith(relativePath,"String_Node_Str")) {
          separator="String_Node_Str";
        }
 else {
          separator="String_Node_Str";
        }
        Vector list=new Vector();
        try {
          list.addAll(sftp.ls(relativePath.isEmpty() ? "String_Node_Str" : relativePath));
        }
 catch (        SftpException e) {
          log.warn("String_Node_Str" + e.getMessage());
        }
        for (        Object object : list) {
          LsEntry entry=(LsEntry)object;
          if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
            fileInfoList.add(new FileInfo(relativePath + separator + entry.getFilename(),entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize()));
          }
        }
      }
    }
    return fileInfoList;
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",e.getMessage()),e);
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167369
Project: 167369
Buggy source:
@Override public void moveFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rename(fromFilePath,toFilePath);
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public void moveFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rename(fromFilePath,toFilePath);
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167370
Project: 167370
Buggy source:
@Override public InputStream getInputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=openConnectedChannel(CHANNEL_IN);
    sftp.cd(basePath);
    if (mustExist && !fileExists(sftp,relativePath)) {
      throw new IoException("String_Node_Str",relativePath);
    }
    return new CloseableInputStreamStream(sftp.get(relativePath),session,sftp,closeSession);
  }
 catch (  Exception e) {
    if (e instanceof IOException || (e instanceof SftpException && ((SftpException)e).id != 2)) {
      throw new IoException("String_Node_Str",e.getMessage());
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public InputStream getInputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_IN);
    sftp.cd(basePath);
    if (mustExist && !fileExists(sftp,relativePath)) {
      throw new IoException("String_Node_Str",relativePath);
    }
    return new CloseableInputStreamStream(sftp.get(relativePath),session,sftp,closeSession);
  }
 catch (  Exception e) {
    if (e instanceof IOException || (e instanceof SftpException && ((SftpException)e).id != 2)) {
      throw new IoException("String_Node_Str",e.getMessage());
    }
 else {
      return null;
    }
  }
}
Program: 167371
Project: 167371
Buggy source:
@Override public boolean renameFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rename(fromFilePath,toFilePath);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public boolean renameFile(String fromFilePath,String toFilePath,boolean closeSession){
  ChannelSftp sftp=null;
  try {
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    sftp.rename(fromFilePath,toFilePath);
    return true;
  }
 catch (  Exception e) {
    return false;
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167372
Project: 167372
Buggy source:
@Override public OutputStream getOutputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=openConnectedChannel(CHANNEL_OUT);
    sftp.cd(basePath);
    createRelativePathDirectoriesIfNecessary(sftp,relativePath,mustExist);
    return new CloseableOutputStream(sftp.put(relativePath,ChannelSftp.OVERWRITE),session,sftp,closeSession);
  }
 catch (  Exception e) {
    throw new IoException(e);
  }
}

Fixed version (ground truth):
@Override public OutputStream getOutputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_OUT);
    sftp.cd(basePath);
    createRelativePathDirectoriesIfNecessary(sftp,relativePath,mustExist);
    return new CloseableOutputStream(sftp.put(relativePath,ChannelSftp.OVERWRITE),session,sftp,closeSession);
  }
 catch (  Exception e) {
    throw new IoException(e);
  }
}
Program: 167373
Project: 167373
Buggy source:
@Override public void copyToDir(String fromFilePath,String toDirPath,boolean closeSession){
  ChannelSftp uploadSftp=null;
  FileInfo fileInfo=new FileInfo(fromFilePath,false,new java.util.Date().getTime(),-1);
  InputStream inputStream=null;
  try {
    uploadSftp=openConnectedChannel(CHANNEL_1);
    uploadSftp.cd(basePath);
    if (!toDirPath.endsWith("String_Node_Str")) {
      toDirPath+="String_Node_Str";
    }
    inputStream=getInputStream(fromFilePath,true);
    uploadSftp.put(inputStream,toDirPath + fileInfo.getName());
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@Override public void copyToDir(String fromFilePath,String toDirPath,boolean closeSession){
  ChannelSftp uploadSftp=null;
  FileInfo fileInfo=new FileInfo(fromFilePath,false,new java.util.Date().getTime(),-1);
  InputStream inputStream=null;
  try {
    uploadSftp=(closeSession) ? openConnectedChannel() : openConnectedChannel(CHANNEL_1);
    uploadSftp.cd(basePath);
    if (!toDirPath.endsWith("String_Node_Str")) {
      toDirPath+="String_Node_Str";
    }
    inputStream=getInputStream(fromFilePath,true);
    uploadSftp.put(inputStream,toDirPath + fileInfo.getName());
  }
 catch (  Exception e) {
    throw new IoException("String_Node_Str",e.getMessage());
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167374
Project: 167374
Buggy source:
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof TextMessage) {
    ArrayList<String> inputRows=((TextMessage)inputMessage).getPayload();
    ArrayList<EntityData> outputPayload=new ArrayList<EntityData>();
    int headerRowsToSkip=inputMessage.getHeader().getSequenceNumber() == 1 ? numberOfHeaderLinesToSkip : 0;
    try {
      int rowCount=0;
      if (inputRows != null) {
        for (        String inputRow : inputRows) {
          if (headerRowsToSkip == 0) {
            if (rowCount + numberOfFooterLinesToSkip < inputRows.size()) {
              EntityData data=processInputRow(inputMessage,inputRow);
              if (data != null) {
                getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
                outputPayload.add(data);
              }
            }
          }
 else {
            headerRowsToSkip--;
          }
          rowCount++;
        }
      }
    }
 catch (    IOException e) {
      throw new IoException(e);
    }
    callback.sendEntityDataMessage(null,outputPayload);
  }
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof TextMessage) {
    ArrayList<String> inputRows=((TextMessage)inputMessage).getPayload();
    ArrayList<EntityData> outputPayload=new ArrayList<EntityData>();
    int headerRowsToSkip=inputMessage.getHeader().getSequenceNumber() == 0 ? numberOfHeaderLinesToSkip : 0;
    try {
      int rowCount=0;
      if (inputRows != null) {
        for (        String inputRow : inputRows) {
          if (headerRowsToSkip == 0) {
            if (rowCount + numberOfFooterLinesToSkip < inputRows.size()) {
              EntityData data=processInputRow(inputMessage,inputRow);
              if (data != null) {
                getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
                outputPayload.add(data);
              }
            }
          }
 else {
            headerRowsToSkip--;
          }
          rowCount++;
        }
      }
    }
 catch (    IOException e) {
      throw new IoException(e);
    }
    callback.sendEntityDataMessage(null,outputPayload);
  }
}
Program: 167375
Project: 167375
Buggy source:
private Message createMessage(Message newMessage,Map<String,Serializable> headerSettings){
  ComponentStatistics statistics=componentContext.getComponentStatistics();
  MessageHeader header=newMessage.getHeader();
  Message inputMessage=currentInputMessages.get(ThreadUtils.getThreadNumber(threadCount));
  if (inputMessage != null) {
    header.putAll(inputMessage.getHeader());
  }
  if (headerSettings != null) {
    header.putAll(headerSettings);
  }
  header.setSequenceNumber(statistics.getNumberOutboundMessages(ThreadUtils.getThreadNumber(threadCount)) + 1);
  return newMessage;
}

Fixed version (ground truth):
private Message createMessage(Message newMessage,Map<String,Serializable> headerSettings){
  ComponentStatistics statistics=componentContext.getComponentStatistics();
  MessageHeader header=newMessage.getHeader();
  Message inputMessage=currentInputMessages.get(ThreadUtils.getThreadNumber(threadCount));
  if (inputMessage != null) {
    header.putAll(inputMessage.getHeader());
  }
  if (headerSettings != null) {
    header.putAll(headerSettings);
  }
  header.setSequenceNumber(statistics.getNumberOutboundMessages(ThreadUtils.getThreadNumber(threadCount)));
  return newMessage;
}
Program: 167376
Project: 167376
Buggy source:
protected Map<Element,Namespace> removeNamespaces(Document document){
  Map<Element,Namespace> namespaces=new HashMap<Element,Namespace>();
  if (ignoreNamespace) {
    namespaces.put(document.getRootElement(),document.getRootElement().getNamespace());
    document.getRootElement().setNamespace(null);
    for (    Element el : document.getRootElement().getDescendants(new ElementFilter())) {
      Namespace nsp=el.getNamespace();
      if (nsp != null) {
        el.setNamespace(null);
        namespaces.put(el,nsp);
      }
    }
  }
  return namespaces;
}

Fixed version (ground truth):
protected Map<Element,Namespace> removeNamespaces(Document document){
  Map<Element,Namespace> namespaces=new HashMap<Element,Namespace>();
  if (ignoreNamespace && document.hasRootElement()) {
    namespaces.put(document.getRootElement(),document.getRootElement().getNamespace());
    document.getRootElement().setNamespace(null);
    for (    Element el : document.getRootElement().getDescendants(new ElementFilter())) {
      Namespace nsp=el.getNamespace();
      if (nsp != null) {
        el.setNamespace(null);
        namespaces.put(el,nsp);
      }
    }
  }
  return namespaces;
}
Program: 167378
Project: 167378
Buggy source:
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  ChannelSftp channel=channels[channelId];
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
    channels[channelId]=channel;
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  return channel;
}

Fixed version (ground truth):
protected ChannelSftp openConnectedChannel(int channelId) throws JSchException {
  Session session=openSession();
  Map<Integer,ChannelSftp> channels=threadChannels.get();
  if (channels == null) {
    channels=new HashMap<Integer,ChannelSftp>();
  }
  ChannelSftp channel=channels.get(channelId);
  if (channel == null || channel.isClosed()) {
    channel=(ChannelSftp)session.openChannel("String_Node_Str");
  }
  if (!channel.isConnected()) {
    channel.connect();
  }
  channels.put(channelId,channel);
  threadChannels.set(channels);
  return channel;
}
Program: 167379
Project: 167379
Buggy source:
public SftpDirectory(Resource resource,String server,Integer port,String user,String password,String basePath,Integer connectionTimeout,boolean mustExist){
  this.server=server;
  this.port=port;
  this.user=user;
  this.password=password;
  this.basePath=basePath;
  this.connectionTimeout=connectionTimeout;
  this.mustExist=mustExist;
  this.threadSession=new ThreadLocal<Session>();
}

Fixed version (ground truth):
public SftpDirectory(Resource resource,String server,Integer port,String user,String password,String basePath,Integer connectionTimeout,boolean mustExist){
  this.server=server;
  this.port=port;
  this.user=user;
  this.password=password;
  this.basePath=basePath;
  this.connectionTimeout=connectionTimeout;
  this.mustExist=mustExist;
  this.threadSession=new ThreadLocal<Session>();
  this.threadChannels=new ThreadLocal<Map<Integer,ChannelSftp>>();
}
Program: 167381
Project: 167381
Buggy source:
private boolean fileExists(ChannelSftp sftp,String filePath){
  try {
    SftpATTRS attributes=sftp.stat(filePath);
    if (attributes != null) {
      return true;
    }
 else {
      return false;
    }
  }
 catch (  SftpException e) {
    log.error("String_Node_Str",e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
private boolean fileExists(ChannelSftp sftp,String filePath){
  try {
    SftpATTRS attributes=sftp.stat(filePath);
    if (attributes != null) {
      return true;
    }
 else {
      return false;
    }
  }
 catch (  SftpException e) {
    log.error(String.format("String_Node_Str",filePath,e.getMessage()));
    return false;
  }
}
Program: 167382
Project: 167382
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public List<FileInfo> listFiles(boolean closeSession,String... relativePaths){
  ChannelSftp sftp=null;
  String separator=null;
  List<FileInfo> fileInfoList=new ArrayList<>();
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    for (    String relativePath : relativePaths) {
      if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
        if (StringUtils.endsWith(relativePath,"String_Node_Str")) {
          separator="String_Node_Str";
        }
 else {
          separator="String_Node_Str";
        }
        if (relativePath.isEmpty()) {
          relativePath="String_Node_Str";
        }
        Vector list=new Vector();
        try {
          list.addAll(sftp.ls(relativePath));
        }
 catch (        SftpException e) {
          log.warn("String_Node_Str" + e.getMessage());
        }
        for (        Object object : list) {
          LsEntry entry=(LsEntry)object;
          if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
            fileInfoList.add(new FileInfo(relativePath + separator + entry.getFilename(),entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize()));
          }
        }
      }
    }
    return fileInfoList;
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",e.getMessage()),e);
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) @Override public List<FileInfo> listFiles(boolean closeSession,String... relativePaths){
  ChannelSftp sftp=null;
  String separator=null;
  List<FileInfo> fileInfoList=new ArrayList<>();
  try {
    sftp=openConnectedChannel(CHANNEL_1);
    sftp.cd(basePath);
    for (    String relativePath : relativePaths) {
      if (!relativePath.equals("String_Node_Str") && !relativePath.equals("String_Node_Str")) {
        if (relativePath.isEmpty() || StringUtils.endsWith(relativePath,"String_Node_Str")) {
          separator="String_Node_Str";
        }
 else {
          separator="String_Node_Str";
        }
        Vector list=new Vector();
        try {
          list.addAll(sftp.ls(relativePath.isEmpty() ? "String_Node_Str" : relativePath));
        }
 catch (        SftpException e) {
          log.warn("String_Node_Str" + e.getMessage());
        }
        for (        Object object : list) {
          LsEntry entry=(LsEntry)object;
          if (!entry.getFilename().equals("String_Node_Str") && !entry.getFilename().equals("String_Node_Str")) {
            fileInfoList.add(new FileInfo(relativePath + separator + entry.getFilename(),entry.getAttrs().isDir(),entry.getAttrs().getMTime(),entry.getAttrs().getSize()));
          }
        }
      }
    }
    return fileInfoList;
  }
 catch (  Exception e) {
    throw new RuntimeException(String.format("String_Node_Str",e.getMessage()),e);
  }
 finally {
    if (closeSession) {
      close();
    }
  }
}
Program: 167383
Project: 167383
Buggy source:
@Override public InputStream getInputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=openConnectedChannel(CHANNEL_IN);
    sftp.cd(basePath);
    if (mustExist && !fileExists(sftp,relativePath)) {
      throw new IoException("String_Node_Str",relativePath);
    }
    return new CloseableInputStreamStream(sftp.get(relativePath),session,sftp,closeSession);
  }
 catch (  Exception e) {
    if (((SftpException)e).id != 2) {
      throw new IoException("String_Node_Str",e.getMessage());
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
@Override public InputStream getInputStream(String relativePath,boolean mustExist,boolean closeSession){
  Session session=null;
  ChannelSftp sftp=null;
  try {
    session=openSession();
    sftp=openConnectedChannel(CHANNEL_IN);
    sftp.cd(basePath);
    if (mustExist && !fileExists(sftp,relativePath)) {
      throw new IoException("String_Node_Str",relativePath);
    }
    return new CloseableInputStreamStream(sftp.get(relativePath),session,sftp,closeSession);
  }
 catch (  Exception e) {
    if (e instanceof IOException || (e instanceof SftpException && ((SftpException)e).id != 2)) {
      throw new IoException("String_Node_Str",e.getMessage());
    }
 else {
      return null;
    }
  }
}
Program: 167384
Project: 167384
Buggy source:
@ExceptionHandler(Exception.class) @ResponseBody public RestError handleError(Exception ex,HttpServletRequest req){
  log.error("String_Node_Str",ex);
  int httpErrorCode=500;
  Annotation annotation=ex.getClass().getAnnotation(ResponseStatus.class);
  if (annotation != null) {
    httpErrorCode=((ResponseStatus)annotation).value().value();
  }
  return new RestError(ex,httpErrorCode);
}

Fixed version (ground truth):
@ExceptionHandler(Exception.class) @ResponseBody public RestError handleError(Exception ex,HttpServletRequest req,HttpServletResponse resp){
  log.error("String_Node_Str",ex);
  int httpErrorCode=500;
  Annotation annotation=ex.getClass().getAnnotation(ResponseStatus.class);
  if (annotation != null) {
    httpErrorCode=((ResponseStatus)annotation).value().value();
  }
  resp.setStatus(httpErrorCode);
  return new RestError(ex,httpErrorCode);
}
Program: 167385
Project: 167385
Buggy source:
protected void addComponent(int x,int y,Component component){
  component.setName(component.getType() + "String_Node_Str" + (countComponentsOfType(component.getType()) + 1));
  component.setProjectVersionId(flow.getProjectVersionId());
  FlowStep flowStep=new FlowStep(component);
  flowStep.setX(x);
  flowStep.setY(y);
  flowStep.setFlowId(flow.getId());
  flow.getFlowSteps().add(flowStep);
  context.getConfigurationService().save(flowStep);
  selected.add(flowStep);
  redrawFlow();
  propertySheet.setSource(flowStep);
  designNavigator.refresh();
}

Fixed version (ground truth):
protected void addComponent(int x,int y,Component component){
  component.setName(component.getType() + "String_Node_Str" + (countComponentsOfType(component.getType()) + 1));
  component.setProjectVersionId(flow.getProjectVersionId());
  FlowStep flowStep=new FlowStep(component);
  flowStep.setX(x);
  flowStep.setY(y);
  flowStep.setFlowId(flow.getId());
  flow.getFlowSteps().add(flowStep);
  context.getConfigurationService().save(flowStep);
  selected=new ArrayList<AbstractObject>(1);
  selected.add(flowStep);
  propertySheet.setSource(selected);
  redrawFlow();
  designNavigator.refresh();
}
Program: 167387
Project: 167387
Buggy source:
protected void newProject(){
  deselectAll();
  Project project=new Project();
  project.setName("String_Node_Str");
  ProjectVersion version=new ProjectVersion();
  version.setVersionLabel("String_Node_Str");
  version.setProject(project);
  project.getProjectVersions().add(version);
  IConfigurationService configurationService=context.getConfigurationService();
  configurationService.save(project);
  configurationService.save(version);
  ProjectVersionItem item=new ProjectVersionItem(project,version);
  grid.getContainerDataSource().addItem(item);
  grid.select(item);
  edit();
}

Fixed version (ground truth):
protected void newProject(){
  deselectAll();
  Project project=new Project();
  project.setName("String_Node_Str");
  ProjectVersion version=new ProjectVersion();
  version.setVersionLabel("String_Node_Str");
  version.setProject(project);
  project.getProjectVersions().add(version);
  IConfigurationService configurationService=context.getConfigurationService();
  configurationService.save(project);
  configurationService.save(version);
  ProjectVersionItem item=new ProjectVersionItem(project,version);
  grid.getContainerDataSource().addItem(item);
  grid.select(item);
}
Program: 167388
Project: 167388
Buggy source:
public void openAdvancedEditor(){
  if (value instanceof FlowStep) {
    FlowStep flowStep=(FlowStep)value;
    String type=flowStep.getComponent().getType();
    IComponentEditPanel panel=context.getUiFactory().create(type);
    if (panel != null) {
      if (panel instanceof IFlowStepAware) {
        Flow flow=context.getConfigurationService().findFlow(flowStep.getFlowId());
        ((IFlowStepAware)panel).makeAwareOf(flowStep,flow);
      }
      panel.init(flowStep.getComponent(),context,this);
      tabs.addCloseableTab(flowStep.getId(),flowStep.getName(),Icons.COMPONENT,panel);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void openAdvancedEditor(){
  FlowStep flowStep=null;
  if (value instanceof List<?>) {
    List<Object> l=(List<Object>)value;
    if (l.size() == 1) {
      if (l.get(0) instanceof FlowStep) {
        flowStep=(FlowStep)l.get(0);
      }
    }
  }
  if (flowStep != null) {
    String type=flowStep.getComponent().getType();
    IComponentEditPanel panel=context.getUiFactory().create(type);
    if (panel != null) {
      if (panel instanceof IFlowStepAware) {
        Flow flow=context.getConfigurationService().findFlow(flowStep.getFlowId());
        ((IFlowStepAware)panel).makeAwareOf(flowStep,flow);
      }
      panel.init(flowStep.getComponent(),context,this);
      tabs.addCloseableTab(flowStep.getId(),flowStep.getName(),Icons.COMPONENT,panel);
    }
  }
}
Program: 167389
Project: 167389
Buggy source:
protected boolean hasAdvancedEditor(){
  if (value instanceof FlowStep) {
    FlowStep flowStep=(FlowStep)value;
    String type=flowStep.getComponent().getType();
    XMLComponentUI definition=context.getUiFactory().getDefinition(type);
    return definition != null && definition.getClassName() != null;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected boolean hasAdvancedEditor(){
  FlowStep flowStep=null;
  if (value instanceof List<?>) {
    List<Object> l=(List<Object>)value;
    if (l.size() == 1) {
      if (l.get(0) instanceof FlowStep) {
        flowStep=(FlowStep)l.get(0);
      }
    }
  }
  if (flowStep != null) {
    String type=flowStep.getComponent().getType();
    XMLComponentUI definition=context.getUiFactory().getDefinition(type);
    return definition != null && definition.getClassName() != null;
  }
 else {
    return false;
  }
}
Program: 167390
Project: 167390
Buggy source:
@Override protected void start(){
  TypedProperties properties=getTypedProperties();
  expectedControlMessageCount=properties.getInt(EXPECTED_CONTROL_MESSAGE_COUNT,expectedEntityMessageCount);
  expectedTextMessageCount=properties.getInt(EXPECTED_TEXT_MESSAGE_COUNT,expectedTextMessageCount);
  expectedEntityMessageCount=properties.getInt(EXPECTED_ENTITY_MESSAGE_COUNT,expectedControlMessageCount);
  expectedEmptyPayloadMessageCount=properties.getInt(EXPECTED_EMPTY_PAYLOAD_MESSAGE_COUNT,expectedEmptyPayloadMessageCount);
  expectedBinaryMessageCount=properties.getInt(EXPECTED_BINARY_MESSAGE_COUNT,expectedBinaryMessageCount);
  expectedSqlCount=properties.getInt(EXPECTED_SQL_COUNT,expectedSqlCount);
  sql=properties.get(ASSERT_SQL);
  dataSourceId=properties.get(ASSERT_SQL_DATASOURCE);
}

Fixed version (ground truth):
@Override protected void start(){
  TypedProperties properties=getTypedProperties();
  expectedControlMessageCount=properties.getInt(EXPECTED_CONTROL_MESSAGE_COUNT,expectedEntityMessageCount);
  expectedTextMessageCount=properties.getInt(EXPECTED_TEXT_MESSAGE_COUNT,expectedTextMessageCount);
  expectedEntityMessageCount=properties.getInt(EXPECTED_ENTITY_MESSAGE_COUNT,expectedControlMessageCount);
  expectedEmptyPayloadMessageCount=properties.getInt(EXPECTED_EMPTY_PAYLOAD_MESSAGE_COUNT,expectedEmptyPayloadMessageCount);
  expectedBinaryMessageCount=properties.getInt(EXPECTED_BINARY_MESSAGE_COUNT,expectedBinaryMessageCount);
  expectedSqlCount=properties.getInt(EXPECTED_SQL_COUNT,expectedSqlCount);
  expectedEntityCountPerMessage=properties.getLong(EXPECTED_ENTITY_COUNT_PER_MESSAGE);
  sql=properties.get(ASSERT_SQL);
  dataSourceId=properties.get(ASSERT_SQL_DATASOURCE);
}
Program: 167391
Project: 167391
Buggy source:
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof ControlMessage) {
    controlMessageCount++;
  }
 else   if (inputMessage instanceof EntityDataMessage) {
    entityMessageCount++;
  }
 else   if (inputMessage instanceof TextMessage) {
    textMessageCount++;
  }
 else   if (inputMessage instanceof BinaryMessage) {
    binaryMessageCount++;
  }
 else {
    emptyPayloadMessageCount++;
  }
  callback.forward(inputMessage);
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof ControlMessage) {
    controlMessageCount++;
  }
 else   if (inputMessage instanceof EntityDataMessage) {
    ArrayList<EntityData> payload=((EntityDataMessage)inputMessage).getPayload();
    entityCountPerMessage=payload.size();
    entityMessageCount++;
  }
 else   if (inputMessage instanceof TextMessage) {
    textMessageCount++;
  }
 else   if (inputMessage instanceof BinaryMessage) {
    binaryMessageCount++;
  }
 else {
    emptyPayloadMessageCount++;
  }
  callback.forward(inputMessage);
}
Program: 167395
Project: 167395
Buggy source:
protected EntityData processCurrentLevel(String path,Map<String,String> currentDataByLevel){
  EntityData data=null;
  XmlFormatterEntitySetting entitySetting=entitySettingsByPath.get(path);
  if (entitySetting != null) {
    data=new EntityData();
    List<XmlFormatterAttributeSetting> attributeSettings=entitySetting.getAttributeSettings();
    for (    XmlFormatterAttributeSetting attributeSetting : attributeSettings) {
      String xpath=attributeSetting.getExpression().getExpression();
      String value=currentDataByLevel.get(xpath);
      if (value != null) {
        data.put(attributeSetting.getSetting().getAttributeId(),value);
      }
    }
  }
  return data;
}

Fixed version (ground truth):
protected List<EntityData> processCurrentLevel(String path,Map<String,String> currentDataByLevel){
  List<EntityData> entitiesData=null;
  EntityData data=null;
  if (entitySettingsByPath.get(path) != null) {
    for (    XmlFormatterEntitySetting entitySetting : entitySettingsByPath.get(path)) {
      if (entitySetting != null) {
        data=new EntityData();
        List<XmlFormatterAttributeSetting> attributeSettings=entitySetting.getAttributeSettings();
        for (        XmlFormatterAttributeSetting attributeSetting : attributeSettings) {
          String xpath=attributeSetting.getExpression().getExpression();
          String value=currentDataByLevel.get(xpath);
          if (value != null) {
            data.put(attributeSetting.getSetting().getAttributeId(),value);
          }
        }
        if (entitiesData == null) {
          entitiesData=new ArrayList<EntityData>();
        }
        entitiesData.add(data);
      }
    }
  }
  return entitiesData;
}
Program: 167396
Project: 167396
Buggy source:
protected void addAttributes(XmlPullParser parser,StringBuilder shortPath,StringBuilder fullPath,Map<String,String> values){
  int attributeCount=parser.getAttributeCount();
  for (int i=0; i < attributeCount; i++) {
    String attributeName=parser.getAttributeName(i);
    String attributeValue=parser.getAttributeValue(i);
    values.put(String.format("String_Node_Str",fullPath,attributeName),attributeValue);
    values.put(String.format("String_Node_Str",shortPath,attributeName),attributeValue);
  }
}

Fixed version (ground truth):
protected void addAttributes(XmlPullParser parser,List<StringBuilder> paths,Map<String,String> values){
  int attributeCount=parser.getAttributeCount();
  for (int i=0; i < attributeCount; i++) {
    String attributeName=parser.getAttributeName(i);
    String attributeValue=parser.getAttributeValue(i);
    for (    StringBuilder path : paths) {
      values.put(String.format("String_Node_Str",path,attributeName),attributeValue);
    }
  }
}
Program: 167398
Project: 167398
Buggy source:
protected void deleteSelected(){
  IConfigurationService configurationService=context.getConfigurationService();
  Iterator<AbstractObject> iter=selected.iterator();
  while (iter.hasNext()) {
    AbstractObject s=iter.next();
    if (s instanceof FlowStep) {
      FlowStep flowStep=(FlowStep)s;
      configurationService.delete(flow,flowStep);
      iter.remove();
    }
 else     if (selected instanceof FlowStepLink) {
      FlowStepLink link=(FlowStepLink)s;
      configurationService.delete(link);
      flow.removeFlowStepLink(link.getSourceStepId(),link.getTargetStepId());
      iter.remove();
    }
  }
  propertySheet.setSource(null);
  redrawFlow();
}

Fixed version (ground truth):
protected void deleteSelected(){
  IConfigurationService configurationService=context.getConfigurationService();
  Iterator<AbstractObject> iter=selected.iterator();
  while (iter.hasNext()) {
    AbstractObject s=iter.next();
    if (s instanceof FlowStep) {
      FlowStep flowStep=(FlowStep)s;
      configurationService.delete(flow,flowStep);
      iter.remove();
    }
 else     if (s instanceof FlowStepLink) {
      FlowStepLink link=(FlowStepLink)s;
      configurationService.delete(link);
      flow.removeFlowStepLink(link.getSourceStepId(),link.getTargetStepId());
      iter.remove();
    }
  }
  propertySheet.setSource(null);
  redrawFlow();
}
Program: 167400
Project: 167400
Buggy source:
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof EntityDataMessage) {
    ArrayList<EntityData> inputRows=((EntityDataMessage)inputMessage).getPayload();
    if (inputRows == null) {
      return;
    }
    ArrayList<EntityData> outputPayload=null;
    for (    EntityData inputRow : inputRows) {
      if (entityPerRecord) {
        outputPayload=mapInputToOutputByEntity(inputRow);
      }
 else {
        outputPayload=mapInputToOutput(inputRow);
      }
    }
    callback.sendEntityDataMessage(null,outputPayload);
  }
}

Fixed version (ground truth):
@Override public void handle(Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkBoundaryReached){
  if (inputMessage instanceof EntityDataMessage) {
    ArrayList<EntityData> inputRows=((EntityDataMessage)inputMessage).getPayload();
    if (inputRows == null) {
      return;
    }
    ArrayList<EntityData> outputPayload=new ArrayList<EntityData>();
    for (    EntityData inputRow : inputRows) {
      if (entityPerRecord) {
        outputPayload.addAll(mapInputToOutputByEntity(inputRow));
      }
 else {
        outputPayload.addAll(mapInputToOutput(inputRow));
      }
    }
    callback.sendEntityDataMessage(null,outputPayload);
  }
}