nus-yam/ex-repair huggingface dataset:
Program: 173199
Project: 173199
Buggy source:
/** 
 * put relevant config parameters to a HashMap to be used as environment variables when submitting jobs
 * @param config
 * @return
 */
public static Map<AuroraField,String> constructEnvVariables(Config config){
  HashMap<AuroraField,String> envs=new HashMap<AuroraField,String>();
  envs.put(AuroraField.TWISTER2_PACKAGE_PATH,AuroraClientContext.packagePath(config));
  envs.put(AuroraField.TWISTER2_PACKAGE_FILE,AuroraClientContext.packageFile(config));
  envs.put(AuroraField.CLUSTER,AuroraClientContext.cluster(config));
  envs.put(AuroraField.ENVIRONMENT,AuroraClientContext.environment(config));
  envs.put(AuroraField.ROLE,AuroraClientContext.role(config));
  envs.put(AuroraField.AURORA_JOB_NAME,AuroraClientContext.auroraJobName(config));
  envs.put(AuroraField.CPUS_PER_CONTAINER,AuroraClientContext.cpusPerContainer(config));
  envs.put(AuroraField.RAM_PER_CONTAINER,AuroraClientContext.ramPerContainer(config) + "String_Node_Str");
  envs.put(AuroraField.DISK_PER_CONTAINER,AuroraClientContext.diskPerContainer(config) + "String_Node_Str");
  envs.put(AuroraField.NUMBER_OF_CONTAINERS,AuroraClientContext.numberOfContainers(config));
  return envs;
}

Fixed version (ground truth):
/** 
 * put relevant config parameters to a HashMap to be used as environment variables when submitting jobs
 */
public static Map<AuroraField,String> constructEnvVariables(Config config){
  HashMap<AuroraField,String> envs=new HashMap<AuroraField,String>();
  envs.put(AuroraField.TWISTER2_PACKAGE_PATH,AuroraClientContext.packagePath(config));
  envs.put(AuroraField.TWISTER2_PACKAGE_FILE,AuroraClientContext.packageFile(config));
  envs.put(AuroraField.CLUSTER,AuroraClientContext.cluster(config));
  envs.put(AuroraField.ENVIRONMENT,AuroraClientContext.environment(config));
  envs.put(AuroraField.ROLE,AuroraClientContext.role(config));
  envs.put(AuroraField.AURORA_JOB_NAME,AuroraClientContext.auroraJobName(config));
  envs.put(AuroraField.CPUS_PER_CONTAINER,AuroraClientContext.cpusPerContainer(config));
  envs.put(AuroraField.RAM_PER_CONTAINER,AuroraClientContext.ramPerContainer(config) + "String_Node_Str");
  envs.put(AuroraField.DISK_PER_CONTAINER,AuroraClientContext.diskPerContainer(config) + "String_Node_Str");
  envs.put(AuroraField.NUMBER_OF_CONTAINERS,AuroraClientContext.numberOfContainers(config));
  return envs;
}
Program: 173200
Project: 173200
Buggy source:
public static void main(String[] args){
  Options cmdOptions=null;
  try {
    cmdOptions=setupOptions();
    CommandLineParser parser=new DefaultParser();
    CommandLine cmd=parser.parse(cmdOptions,args);
    Config config=loadConfigurations(cmd);
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + config.size());
    System.out.println(config);
    String cluster=AuroraClientContext.cluster(config);
    String role=AuroraClientContext.role(config);
    String env=AuroraClientContext.environment(config);
    String jobName=AuroraClientContext.auroraJobName(config);
    AuroraClientController controller=new AuroraClientController(cluster,role,env,jobName,true);
    String auroraFilename=AuroraClientContext.auroraScript(config);
    Map<AuroraField,String> bindings=constructEnvVariables(config);
    printEnvs(bindings);
    boolean jobSubmitted=controller.createJob(bindings,auroraFilename);
    if (jobSubmitted)     LOG.log(Level.INFO,"String_Node_Str");
 else     LOG.log(Level.SEVERE,"String_Node_Str");
  }
 catch (  ParseException e) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp("String_Node_Str",cmdOptions);
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  Options cmdOptions=null;
  try {
    cmdOptions=setupOptions();
    CommandLineParser parser=new DefaultParser();
    CommandLine cmd=parser.parse(cmdOptions,args);
    Config config=loadConfigurations(cmd);
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + config.size());
    System.out.println(config);
    String cluster=AuroraClientContext.cluster(config);
    String role=AuroraClientContext.role(config);
    String env=AuroraClientContext.environment(config);
    String jobName=AuroraClientContext.auroraJobName(config);
    AuroraClientController controller=new AuroraClientController(cluster,role,env,jobName,true);
    String auroraFilename=AuroraClientContext.auroraScript(config);
    Map<AuroraField,String> bindings=constructEnvVariables(config);
    printEnvs(bindings);
    boolean jobSubmitted=controller.createJob(bindings,auroraFilename);
    if (jobSubmitted) {
      LOG.log(Level.INFO,"String_Node_Str");
    }
 else {
      LOG.log(Level.SEVERE,"String_Node_Str");
    }
  }
 catch (  ParseException e) {
    HelpFormatter formatter=new HelpFormatter();
    formatter.printHelp("String_Node_Str",cmdOptions);
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 173201
Project: 173201
Buggy source:
/** 
 * read config parameters from configuration files all config files are in a single directory
 * @param cmd
 * @return Config object that has values from config files and from command line
 */
private static Config loadConfigurations(CommandLine cmd){
  String twister2Home=cmd.getOptionValue("String_Node_Str");
  String configDir=cmd.getOptionValue("String_Node_Str");
  String clusterName=cmd.getOptionValue("String_Node_Str");
  LOG.log(Level.INFO,String.format("String_Node_Str" + "String_Node_Str",twister2Home,configDir,clusterName));
  try {
    Class.forName(AuroraClientContext.class.getName());
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Config config=ConfigLoader.loadConfig(twister2Home,configDir + "String_Node_Str" + clusterName);
  return Config.newBuilder().putAll(config).put(SchedulerContext.TWISTER2_HOME.getKey(),twister2Home).put(SchedulerContext.TWISTER2_CLUSTER_NAME,clusterName).build();
}

Fixed version (ground truth):
/** 
 * read config parameters from configuration files all config files are in a single directory
 * @return Config object that has values from config files and from command line
 */
private static Config loadConfigurations(CommandLine cmd){
  String twister2Home=cmd.getOptionValue("String_Node_Str");
  String configDir=cmd.getOptionValue("String_Node_Str");
  String clusterName=cmd.getOptionValue("String_Node_Str");
  LOG.log(Level.INFO,String.format("String_Node_Str" + "String_Node_Str",twister2Home,configDir,clusterName));
  try {
    Class.forName(AuroraClientContext.class.getName());
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Config config=ConfigLoader.loadConfig(twister2Home,configDir + "String_Node_Str" + clusterName);
  return Config.newBuilder().putAll(config).put(SchedulerContext.TWISTER2_HOME.getKey(),twister2Home).put(SchedulerContext.TWISTER2_CLUSTER_NAME,clusterName).build();
}
Program: 173202
Project: 173202
Buggy source:
/** 
 * print all environment variables for debuging purposes
 * @param envs
 */
public static void printEnvs(Map<AuroraField,String> envs){
  LOG.log(Level.INFO,"String_Node_Str");
  Set<AuroraField> keys=envs.keySet();
  for (  AuroraField key : keys) {
    System.out.println(key + "String_Node_Str" + envs.get(key));
  }
}

Fixed version (ground truth):
/** 
 * print all environment variables for debuging purposes
 */
public static void printEnvs(Map<AuroraField,String> envs){
  LOG.log(Level.INFO,"String_Node_Str");
  Set<AuroraField> keys=envs.keySet();
  for (  AuroraField key : keys) {
    System.out.println(key + "String_Node_Str" + envs.get(key));
  }
}
Program: 173203
Project: 173203
Buggy source:
@Override public void initialize(Config config){
  this.config=config;
  String cluster=AuroraClientContext.cluster(config);
  String role=AuroraClientContext.role(config);
  String env=AuroraClientContext.environment(config);
  String jobName=AuroraClientContext.auroraJobName(config);
  controller=new AuroraClientController(cluster,role,env,jobName,true);
}

Fixed version (ground truth):
@Override public void initialize(Config conf){
  this.config=conf;
  String cluster=AuroraClientContext.cluster(conf);
  String role=AuroraClientContext.role(conf);
  String env=AuroraClientContext.environment(conf);
  String jobName=AuroraClientContext.auroraJobName(conf);
  controller=new AuroraClientController(cluster,role,env,jobName,true);
}
Program: 173204
Project: 173204
Buggy source:
public IntData(){
}

Fixed version (ground truth):
public IntData(int size){
  int[] d=new int[size];
  for (int i=0; i < size; i++) {
    d[i]=i;
  }
  this.data=d;
}
Program: 173205
Project: 173205
Buggy source:
public synchronized int read(byte[] b,int off,int len){
  ByteBuffer byteBuffer=getReadBuffer();
  if (byteBuffer == null) {
    return -1;
  }
  if (byteBuffer.remaining() >= 1) {
    int copiedLength=byteBuffer.remaining() > len ? len : byteBuffer.remaining();
    byteBuffer.get(b,off,copiedLength);
    return copiedLength;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public synchronized int read(byte[] b,int off,int len){
  ByteBuffer byteBuffer=getReadBuffer();
  if (byteBuffer == null) {
    return -1;
  }
  int canCopy=length - copiedBytes;
  if (byteBuffer.remaining() >= 1) {
    int copiedLength=0;
    if (byteBuffer.remaining() > len) {
      copiedLength=len > canCopy ? canCopy : len;
    }
 else {
      copiedLength=byteBuffer.remaining() > canCopy ? canCopy : byteBuffer.remaining();
    }
    byteBuffer.get(b,off,copiedLength);
    copiedBytes+=copiedLength;
    return copiedLength;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 173206
Project: 173206
Buggy source:
public synchronized void reset(){
}

Fixed version (ground truth):
public synchronized void reset(){
  copiedBytes=0;
  currentBufferIndex=0;
}
Program: 173207
Project: 173207
Buggy source:
private ByteBuffer getReadBuffer(){
  ByteBuffer byteBuffer=bufs.get(currentBufferIndex).getByteBuffer();
  int pos=byteBuffer.position();
  if (pos >= byteBuffer.limit() - 1) {
    currentBufferIndex++;
    byteBuffer=bufs.get(currentBufferIndex).getByteBuffer();
    byteBuffer.rewind();
    if (currentBufferIndex >= bufs.size()) {
      return null;
    }
  }
  return byteBuffer;
}

Fixed version (ground truth):
private ByteBuffer getReadBuffer(){
  if (copiedBytes >= length) {
    return null;
  }
  ByteBuffer byteBuffer=bufs.get(currentBufferIndex).getByteBuffer();
  int pos=byteBuffer.position();
  if (pos >= byteBuffer.limit() - 1) {
    currentBufferIndex++;
    byteBuffer=bufs.get(currentBufferIndex).getByteBuffer();
    byteBuffer.rewind();
    if (currentBufferIndex >= bufs.size()) {
      return null;
    }
  }
  return byteBuffer;
}
Program: 173208
Project: 173208
Buggy source:
public synchronized long skip(long n){
  if (n < 0) {
    return 0;
  }
  int skipped=0;
  for (int i=currentBufferIndex; i < bufs.size(); i++) {
    ByteBuffer b=bufs.get(i).getByteBuffer();
    int avail;
    long needSkip=n - skipped;
    int bufPos=b.position();
    avail=b.remaining() - bufPos;
    if (needSkip >= avail) {
      b.position(bufPos + avail);
      currentBufferIndex++;
      skipped+=avail;
    }
 else {
      b.position((int)(bufPos + needSkip));
      skipped+=needSkip;
    }
    if (skipped >= n) {
      break;
    }
  }
  return skipped;
}

Fixed version (ground truth):
public synchronized long skip(long n){
  if (n < 0) {
    return 0;
  }
  int skipped=0;
  for (int i=currentBufferIndex; i < bufs.size(); i++) {
    ByteBuffer b=bufs.get(i).getByteBuffer();
    int avail;
    long needSkip=n - skipped;
    int bufPos=b.position();
    avail=b.remaining() - bufPos;
    int canCopy=length - (copiedBytes + skipped);
    if (needSkip >= avail) {
      avail=canCopy > avail ? avail : canCopy;
      b.position(bufPos + avail);
      currentBufferIndex++;
      skipped+=avail;
      copiedBytes+=skipped;
    }
 else {
      needSkip=canCopy > needSkip ? needSkip : canCopy;
      b.position((int)(bufPos + needSkip));
      skipped+=needSkip;
      copiedBytes+=skipped;
    }
    if (skipped >= n) {
      break;
    }
  }
  return skipped;
}
Program: 173209
Project: 173209
Buggy source:
@SuppressWarnings("String_Node_Str") private void serializeBody(Object object,MPISendMessage sendMessage,MPIBuffer buffer){
  List objectList=(List)object;
  SerializeState state=(SerializeState)sendMessage.getSerializationState();
  int startIndex=state.getCurrentObject();
  int remaining=buffer.getCapacity();
  if (remaining < 6) {
    return;
  }
  ByteBuffer byteBuffer=buffer.getByteBuffer();
  for (int i=startIndex; i < objectList.size(); i++) {
    Object o=objectList.get(i);
    if (o instanceof MPIMessage) {
      MPIMessage mpiMessage=(MPIMessage)o;
      boolean complete=serializeBufferedMessage(mpiMessage,state,buffer);
      if (complete) {
        state.setCurrentObject(startIndex + 1);
      }
    }
 else {
      boolean complete=serializeMessage((MultiObject)o,sendMessage,buffer);
      if (complete) {
        state.setCurrentObject(startIndex + 1);
      }
    }
    remaining=buffer.getByteBuffer().remaining();
    if (!(remaining > 6 && state.getCurrentObject() < objectList.size() - 1)) {
      break;
    }
  }
  if (state.getCurrentObject() == objectList.size()) {
    sendMessage.setSendState(MPISendMessage.SendState.SERIALIZED);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void serializeBody(Object object,MPISendMessage sendMessage,MPIBuffer buffer){
  List objectList=(List)object;
  SerializeState state=(SerializeState)sendMessage.getSerializationState();
  int startIndex=state.getCurrentObject();
  int remaining=buffer.getCapacity();
  if (remaining < 6) {
    return;
  }
  for (int i=startIndex; i < objectList.size(); i++) {
    Object o=objectList.get(i);
    if (o instanceof MPIMessage) {
      MPIMessage mpiMessage=(MPIMessage)o;
      boolean complete=serializeBufferedMessage(mpiMessage,state,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
      }
    }
 else {
      boolean complete=serializeMessage((MultiObject)o,sendMessage,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
      }
    }
    remaining=buffer.getByteBuffer().remaining();
    if (!(remaining > 6 && state.getCurrentObject() < objectList.size())) {
      break;
    }
  }
  if (state.getCurrentObject() == objectList.size()) {
    sendMessage.setSendState(MPISendMessage.SendState.SERIALIZED);
  }
}
Program: 173210
Project: 173210
Buggy source:
private MPIMessage serializeObject(Object object,int source){
  MultiObject multiObject=new MultiObject(source,object);
  MultiObject multiObject2=new MultiObject(source,object);
  List<Object> list=new ArrayList<>();
  list.add(multiObject);
  list.add(multiObject2);
  MPIMessage mpiMessage=new MPIMessage(source,MessageType.OBJECT,MPIMessageDirection.OUT,new MessageListener());
  int di=-1;
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,0,di,0,MPIContext.FLAGS_MULTI_MSG,null,null);
  multiMessageSerializer.build(list,sendMessage);
  return mpiMessage;
}

Fixed version (ground truth):
private MPIMessage serializeObject(Object object,int source){
  IntData data1=new IntData(10);
  MultiObject multiObject=new MultiObject(source,data1);
  IntData data2=new IntData(100);
  MultiObject multiObject2=new MultiObject(source,data2);
  List<Object> list=new ArrayList<>();
  list.add(multiObject);
  list.add(multiObject2);
  MPIMessage mpiMessage=new MPIMessage(source,MessageType.OBJECT,MPIMessageDirection.OUT,new MessageListener());
  int di=-1;
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,0,di,0,MPIContext.FLAGS_MULTI_MSG,null,null);
  multiMessageSerializer.build(list,sendMessage);
  return mpiMessage;
}
Program: 173211
Project: 173211
Buggy source:
@Override public void init(Config config,int id,ResourcePlan resourcePlan){
  Config.Builder builder=new Config.Builder();
  builder.put("String_Node_Str","String_Node_Str" + "String_Node_Str");
  Config txtFileConf=builder.build();
  Path path=new Path("String_Node_Str" + "String_Node_Str");
  InputFormat txtInput=new TextInputFormatter(path);
  txtInput.configure(txtFileConf);
  int minSplits=8;
  try {
    InputSplit[] inputSplits=txtInput.createInputSplits(minSplits);
    InputSplitAssigner inputSplitAssigner=txtInput.getInputSplitAssigner(inputSplits);
    Mapper wordCountMapper=new Mapper();
    wordCountMapper.setInputSource(inputSplitAssigner.getNextInputSplit(null,id));
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void init(Config config,int id,ResourcePlan resourcePlan){
  Config.Builder builder=new Config.Builder();
  builder.put("String_Node_Str","String_Node_Str" + "String_Node_Str");
  Config txtFileConf=builder.build();
  Path path=new Path("String_Node_Str" + "String_Node_Str");
  @SuppressWarnings("String_Node_Str") InputFormat txtInput=new TextInputFormatter(path);
  txtInput.configure(txtFileConf);
  int minSplits=8;
  try {
    InputSplit[] inputSplits=txtInput.createInputSplits(minSplits);
    InputSplitAssigner inputSplitAssigner=txtInput.getInputSplitAssigner(inputSplits);
    MapperSource mapperSource=new MapperSource(txtInput,inputSplitAssigner.getNextInputSplit(null,id));
    Mapper wordCountMapper=new Mapper();
    wordCountMapper.setInputSource(mapperSource);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 173212
Project: 173212
Buggy source:
@Override public TV getTaskEdgeSource(TE taskEdge){
  return TypeUtil.uncheckedCast(getIntrusiveTaskEdge(taskEdge).source,vertexTypeDecl);
}

Fixed version (ground truth):
@Override public TV getTaskEdgeSource(TE taskEdge){
  return vertexTypeDecl.uncheckedCast(getIntrusiveTaskEdge(taskEdge).source,vertexTypeDecl);
}
Program: 173213
Project: 173213
Buggy source:
@Override public TV getTaskEdgeTarget(TE taskEdge){
  return TypeUtil.uncheckedCast(getIntrusiveTaskEdge(taskEdge).target,vertexTypeDecl);
}

Fixed version (ground truth):
@Override public TV getTaskEdgeTarget(TE taskEdge){
  return vertexTypeDecl.uncheckedCast(getIntrusiveTaskEdge(taskEdge).target,vertexTypeDecl);
}
Program: 173214
Project: 173214
Buggy source:
public DataflowTaskGraph(TaskEdgeFactory<TV,TE> taskEdgeFactory){
  super(taskEdgeFactory);
}

Fixed version (ground truth):
public DataflowTaskGraph(IDataflowTaskEdgeFactory<TV,TE> taskEdgeFactory){
  super(taskEdgeFactory);
}
Program: 173215
Project: 173215
Buggy source:
public IDataflowTaskGraph<Mapper,DefaultTaskEdge> getTaskGraph(){
  return taskGraph;
}

Fixed version (ground truth):
public IDataflowTaskGraph<Mapper,DefaultDataflowTaskEdge> getTaskGraph(){
  return taskGraph;
}
Program: 173216
Project: 173216
Buggy source:
public void setTaskGraph(IDataflowTaskGraph<Mapper,DefaultTaskEdge> taskGraph){
  this.taskGraph=taskGraph;
}

Fixed version (ground truth):
public void setTaskGraph(IDataflowTaskGraph<Mapper,DefaultDataflowTaskEdge> taskGraph){
  this.taskGraph=taskGraph;
}
Program: 173217
Project: 173217
Buggy source:
private IntrusiveTaskEdge createIntrusiveTaskEdge(TE taskEdge,TV taskVertex1,TV taskVertex2){
  IntrusiveTaskEdge intrusiveTaskEdge;
  if (taskEdge instanceof IntrusiveTaskEdge) {
    intrusiveTaskEdge=(IntrusiveTaskEdge)taskEdge;
    System.out.println("String_Node_Str" + intrusiveTaskEdge);
  }
 else {
    intrusiveTaskEdge=new IntrusiveTaskEdge();
    System.out.println("String_Node_Str" + intrusiveTaskEdge);
  }
  return intrusiveTaskEdge;
}

Fixed version (ground truth):
private IntrusiveTaskEdge createIntrusiveTaskEdge(TE taskEdge,TV taskVertex1,TV taskVertex2){
  IntrusiveTaskEdge intrusiveTaskEdge;
  if (taskEdge instanceof IntrusiveTaskEdge) {
    intrusiveTaskEdge=(IntrusiveTaskEdge)taskEdge;
    System.out.println("String_Node_Str" + intrusiveTaskEdge);
  }
 else {
    intrusiveTaskEdge=new IntrusiveTaskEdge();
    System.out.println("String_Node_Str" + intrusiveTaskEdge);
  }
  intrusiveTaskEdge.source=taskVertex1;
  intrusiveTaskEdge.target=taskVertex2;
  return intrusiveTaskEdge;
}
Program: 173218
Project: 173218
Buggy source:
public CManager(String message){
  this.message=message;
}

Fixed version (ground truth):
protected CManager(String message){
  this.message=message;
}
Program: 173219
Project: 173219
Buggy source:
/** 
 * This method returns the set of incoming task edges for the task vertex 'TV'
 * @param taskVertex
 * @return
 */
Set<TE> incomingTaskEdgesOf(TV taskVertex);

Fixed version (ground truth):
/** 
 * This method returns the set of incoming task edges for the task vertex 'TV'
 */
Set<TE> incomingTaskEdgesOf(TV taskVertex);
Program: 173220
Project: 173220
Buggy source:
/** 
 * This method returns the set of outgoing task edges for the task vertex 'TV'
 * @param taskVertex
 * @return
 */
Set<TE> outgoingTaskEdgesOf(TV taskVertex);

Fixed version (ground truth):
/** 
 * This method returns the set of outgoing task edges for the task vertex 'TV'
 */
Set<TE> outgoingTaskEdgesOf(TV taskVertex);
Program: 173221
Project: 173221
Buggy source:
/** 
 * This method returns the set of outward task edges for the task vertex 'TV'
 * @param taskVertex
 * @return
 */
int outDegreeOf(TV taskVertex);

Fixed version (ground truth):
/** 
 * This method returns the set of outward task edges for the task vertex 'TV'
 */
int outDegreeOf(TV taskVertex);
Program: 173222
Project: 173222
Buggy source:
/** 
 * This method is responsible for returning the number of inward directed edges for the task vertex 'TV'
 * @param taskVertex
 * @return
 */
int inDegreeOf(TV taskVertex);

Fixed version (ground truth):
/** 
 * This method is responsible for returning the number of inward directed edges for the task vertex 'TV'
 */
int inDegreeOf(TV taskVertex);
Program: 173223
Project: 173223
Buggy source:
/** 
 * Create path from given path String
 */
public Path(String pathString){
  pathString=checkAndTrimPathArg(pathString);
  if (hasWindowsDrive(pathString,false)) {
    pathString="String_Node_Str" + pathString;
  }
  String scheme=null;
  String authority=null;
  int start=0;
  final int colon=pathString.indexOf(':');
  final int slash=pathString.indexOf('/');
  if ((colon != -1) && ((slash == -1) || (colon < slash))) {
    scheme=pathString.substring(0,colon);
    start=colon + 1;
  }
  if (pathString.startsWith("String_Node_Str",start) && (pathString.length() - start > 2)) {
    final int nextSlash=pathString.indexOf('/',start + 2);
    final int authEnd=nextSlash > 0 ? nextSlash : pathString.length();
    authority=pathString.substring(start + 2,authEnd);
    start=authEnd;
  }
  final String path=pathString.substring(start,pathString.length());
  initialize(scheme,authority,path);
}

Fixed version (ground truth):
/** 
 * Create path from given path String
 */
public Path(String pathString){
  String curpathString=checkAndTrimPathArg(pathString);
  if (hasWindowsDrive(curpathString,false)) {
    curpathString="String_Node_Str" + curpathString;
  }
  String scheme=null;
  String authority=null;
  int start=0;
  final int colon=curpathString.indexOf(':');
  final int slash=curpathString.indexOf('/');
  if ((colon != -1) && ((slash == -1) || (colon < slash))) {
    scheme=curpathString.substring(0,colon);
    start=colon + 1;
  }
  if (curpathString.startsWith("String_Node_Str",start) && (curpathString.length() - start > 2)) {
    final int nextSlash=curpathString.indexOf('/',start + 2);
    final int authEnd=nextSlash > 0 ? nextSlash : curpathString.length();
    authority=curpathString.substring(start + 2,authEnd);
    start=authEnd;
  }
  final String path=curpathString.substring(start,curpathString.length());
  initialize(scheme,authority,path);
}
Program: 173224
Project: 173224
Buggy source:
private String checkAndTrimPathArg(String path){
  if (path == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  path=path.trim();
  if (path.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return path;
}

Fixed version (ground truth):
private String checkAndTrimPathArg(String path){
  if (path == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  String curpath=path.trim();
  if (curpath.length() == 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return curpath;
}
Program: 173225
Project: 173225
Buggy source:
private String normalizePath(String path){
  path=path.trim();
  path=path.replace("String_Node_Str","String_Node_Str");
  path=path.replaceAll("String_Node_Str","String_Node_Str");
  if (!path.equals(SEPARATOR) && !path.matches("String_Node_Str") && path.endsWith(SEPARATOR)) {
    path=path.substring(0,path.length() - SEPARATOR.length());
  }
  return path;
}

Fixed version (ground truth):
private String normalizePath(String path){
  String curPath=path.trim();
  curPath=curPath.replace("String_Node_Str","String_Node_Str");
  curPath=curPath.replaceAll("String_Node_Str","String_Node_Str");
  if (!curPath.equals(SEPARATOR) && !curPath.matches("String_Node_Str") && curPath.endsWith(SEPARATOR)) {
    curPath=curPath.substring(0,curPath.length() - SEPARATOR.length());
  }
  return curPath;
}
Program: 173226
Project: 173226
Buggy source:
public LocatableInputSplit getSplit(){
  return this.split;
}

Fixed version (ground truth):
LocatableInputSplit getSplit(){
  return this.split;
}
Program: 173228
Project: 173228
Buggy source:
public int getLocalCount(){
  return this.localCount;
}

Fixed version (ground truth):
int getLocalCount(){
  return this.localCount;
}
Program: 173229
Project: 173229
Buggy source:
public LocatableInputSplitWithCount(LocatableInputSplit split){
  this.split=split;
  this.localCount=0;
}

Fixed version (ground truth):
LocatableInputSplitWithCount(LocatableInputSplit split){
  this.split=split;
  this.localCount=0;
}
Program: 173230
Project: 173230
Buggy source:
public LocatableInputSplitChooser(Collection<LocatableInputSplitWithCount> splits){
  this.splits=new LinkedList<LocatableInputSplitWithCount>();
  for (  LocatableInputSplitWithCount isw : splits) {
    this.addInputSplit(isw);
  }
}

Fixed version (ground truth):
LocatableInputSplitChooser(Collection<LocatableInputSplitWithCount> splits){
  this.splits=new LinkedList<LocatableInputSplitWithCount>();
  for (  LocatableInputSplitWithCount isw : splits) {
    this.addInputSplit(isw);
  }
}
Program: 173231
Project: 173231
Buggy source:
public void incrementLocalCount(){
  this.localCount++;
}

Fixed version (ground truth):
void incrementLocalCount(){
  this.localCount++;
}
Program: 173232
Project: 173232
Buggy source:
private static final boolean isLocal(String flinkHost,String[] hosts){
  if (flinkHost == null || hosts == null) {
    return false;
  }
  for (  String h : hosts) {
    if (h != null && NetUtils.getHostnameFromFQDN(h.toLowerCase()).equals(flinkHost)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean isLocal(String flinkHost,String[] hosts){
  if (flinkHost == null || hosts == null) {
    return false;
  }
  for (  String h : hosts) {
    if (h != null && NetUtils.getHostnameFromFQDN(h.toLowerCase()).equals(flinkHost)) {
      return true;
    }
  }
  return false;
}
Program: 173233
Project: 173233
Buggy source:
private File pathToFile(Path path){
  if (!path.isAbsolute()) {
    path=new Path(getWorkingDirectory(),path);
  }
  return new File(path.toUri().getPath());
}

Fixed version (ground truth):
private File pathToFile(Path path){
  Path curPath=path;
  if (!path.isAbsolute()) {
    curPath=new Path(getWorkingDirectory(),path);
  }
  return new File(curPath.toUri().getPath());
}
Program: 173234
Project: 173234
Buggy source:
@Override public void run(){
}

Fixed version (ground truth):
@Override public void run(){
  if (executableTask == null) {
    throw new RuntimeException("String_Node_Str");
  }
  LOG.info(String.format("String_Node_Str",executableTask.getTaskId(),messageProcessLimit));
  if (isMessageBased) {
    while (!queueRef.isEmpty()) {
      if (messageProcessCount < messageProcessLimit) {
        executableTask.execute(queueRef.poll());
        messageProcessCount++;
      }
 else {
        LOG.info("String_Node_Str");
        TaskExecutorFixedThread.executorPool.submit(new RunnableFixedTask(executableTask,queueRef,messageProcessLimit));
        return;
      }
    }
synchronized (ExecutorContext.FIXED_EXECUTOR_LOCK) {
      if (!queueRef.isEmpty()) {
        LOG.info("String_Node_Str");
        TaskExecutorFixedThread.executorPool.submit(new RunnableFixedTask(executableTask,queueRef,messageProcessLimit));
      }
 else {
        TaskExecutorFixedThread.removeRunningTask(executableTask.getTaskId());
      }
    }
  }
 else {
    executableTask.execute();
    TaskExecutorFixedThread.removeRunningTask(executableTask.getTaskId());
  }
}
Program: 173235
Project: 173235
Buggy source:
public void setEndianess(ByteOrder endianess){
  if (endianess == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.endianess=endianess;
}

Fixed version (ground truth):
public void setEndianess(ByteOrder order){
  if (endianess == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.endianess=order;
}
Program: 173236
Project: 173236
Buggy source:
public void setBufferSize(int bufferSize){
  if (bufferSize < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.bufferSize=bufferSize;
}

Fixed version (ground truth):
public void setBufferSize(int buffSize){
  if (bufferSize < 2) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.bufferSize=buffSize;
}
Program: 173238
Project: 173238
Buggy source:
/** 
 * Reads a single record from the binary file
 */
public byte[] readRecord(byte[] reusable,byte[] bytes,int offset,int numBytes) throws IOException {
  if (reusable != null && reusable.length == this.recordLength) {
    System.arraycopy(bytes,offset,reusable,0,numBytes);
    return reusable;
  }
 else {
    byte[] tmp=new byte[this.recordLength];
    System.arraycopy(bytes,offset,tmp,0,numBytes);
    return tmp;
  }
}

Fixed version (ground truth):
/** 
 * Reads a single record from the binary file
 */
public byte[] readRecord(byte[] reusable,byte[] bytes,int readOffset,int numBytes) throws IOException {
  if (reusable != null && reusable.length == this.recordLength) {
    System.arraycopy(bytes,readOffset,reusable,0,numBytes);
    return reusable;
  }
 else {
    byte[] tmp=new byte[this.recordLength];
    System.arraycopy(bytes,readOffset,tmp,0,numBytes);
    return tmp;
  }
}
Program: 173239
Project: 173239
Buggy source:
/** 
 * Configures this input format by reading the path to the file from the configuration and setting the record length
 * @param parameters The configuration object to read the parameters from.
 */
@Override public void configure(Config parameters){
  super.configure(parameters);
  int recordLength=parameters.getIntegerValue(RECORD_LENGTH,-1);
  if (recordLength > 0) {
    setRecordLength(recordLength);
  }
}

Fixed version (ground truth):
/** 
 * Configures this input format by reading the path to the file from the configuration and setting the record length
 * @param parameters The configuration object to read the parameters from.
 */
@Override public void configure(Config parameters){
  super.configure(parameters);
  int recordLen=parameters.getIntegerValue(RECORD_LENGTH,-1);
  if (recordLen > 0) {
    setRecordLength(recordLen);
  }
}
Program: 173240
Project: 173240
Buggy source:
public BinaryInputFormatter(Path filePath,int recordLength){
  super(filePath);
  setRecordLength(recordLength);
}

Fixed version (ground truth):
public BinaryInputFormatter(Path filePath,int recordLen){
  super(filePath);
  setRecordLength(recordLen);
}
Program: 173241
Project: 173241
Buggy source:
public void setRecordLength(int recordLength){
  if (recordLength <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.recordLength=recordLength;
  if (this.bufferSize % recordLength != 0) {
    int bufferFactor=1;
    if (this.bufferSize > 0) {
      bufferFactor=bufferSize / recordLength;
    }
 else {
      bufferFactor=DEFAULT_READ_BUFFER_SIZE / recordLength;
    }
    if (bufferFactor >= 1) {
      setBufferSize(recordLength * bufferFactor);
    }
 else {
      setBufferSize(recordLength * 8);
    }
  }
}

Fixed version (ground truth):
public void setRecordLength(int recordLen){
  if (recordLen <= 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.recordLength=recordLen;
  if (this.bufferSize % recordLen != 0) {
    int bufferFactor=1;
    if (this.bufferSize > 0) {
      bufferFactor=bufferSize / recordLen;
    }
 else {
      bufferFactor=DEFAULT_READ_BUFFER_SIZE / recordLen;
    }
    if (bufferFactor >= 1) {
      setBufferSize(recordLen * bufferFactor);
    }
 else {
      setBufferSize(recordLen * 8);
    }
  }
}
Program: 173242
Project: 173242
Buggy source:
/** 
 * Fills the read buffer with bytes read from the file starting from an offset.
 */
private boolean fillBuffer(int offset) throws IOException {
  int maxReadLength=this.readBuffer.length - offset;
  if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
    int read=this.stream.read(this.readBuffer,offset,maxReadLength);
    if (read == -1) {
      this.stream.close();
      this.stream=null;
      return false;
    }
 else {
      this.readPos=offset;
      this.limit=read;
      return true;
    }
  }
  int toRead;
  if (this.splitLength > 0) {
    toRead=this.splitLength > maxReadLength ? maxReadLength : (int)this.splitLength;
  }
 else {
    toRead=maxReadLength;
    this.overLimit=true;
    return false;
  }
  int read=this.stream.read(this.readBuffer,offset,toRead);
  if (read == -1) {
    this.stream.close();
    this.stream=null;
    return false;
  }
 else {
    this.splitLength-=read;
    this.readPos=offset;
    this.limit=read + offset;
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Fills the read buffer with bytes read from the file starting from an offset.
 */
private boolean fillBuffer(int fillOffset) throws IOException {
  int maxReadLength=this.readBuffer.length - fillOffset;
  if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
    int read=this.stream.read(this.readBuffer,fillOffset,maxReadLength);
    if (read == -1) {
      this.stream.close();
      this.stream=null;
      return false;
    }
 else {
      this.readPos=fillOffset;
      this.limit=read;
      return true;
    }
  }
  int toRead;
  if (this.splitLength > 0) {
    toRead=this.splitLength > maxReadLength ? maxReadLength : (int)this.splitLength;
  }
 else {
    toRead=maxReadLength;
    this.overLimit=true;
    return false;
  }
  int read=this.stream.read(this.readBuffer,fillOffset,toRead);
  if (read == -1) {
    this.stream.close();
    this.stream=null;
    return false;
  }
 else {
    this.splitLength-=read;
    this.readPos=fillOffset;
    this.limit=read + fillOffset;
    return true;
  }
}
Program: 173243
Project: 173243
Buggy source:
private void setResult(byte[] buffer,int offset,int len){
  this.currBuffer=buffer;
  this.currOffset=offset;
  this.currLen=len;
}

Fixed version (ground truth):
private void setResult(byte[] buffer,int resultOffset,int len){
  this.currBuffer=buffer;
  this.currOffset=resultOffset;
  this.currLen=len;
}
Program: 173244
Project: 173244
Buggy source:
/** 
 * This function parses the given byte array which represents a serialized record. The function returns a valid record or throws an IOException.
 * @param reuse An optionally reusable object.
 * @param bytes Binary data of serialized records.
 * @param offset The offset where to start to read the record data.
 * @param numBytes The number of bytes that can be read starting at the offset position.
 * @return Returns the read record if it was successfully deserialized.
 * @throws IOException if the record could not be read.
 */
public abstract OT readRecord(OT reuse,byte[] bytes,int offset,int numBytes) throws IOException ;

Fixed version (ground truth):
/** 
 * This function parses the given byte array which represents a serialized record. The function returns a valid record or throws an IOException.
 * @param reuse An optionally reusable object.
 * @param bytes Binary data of serialized records.
 * @param readOffset The offset where to start to read the record data.
 * @param numBytes The number of bytes that can be read starting at the offset position.
 * @return Returns the read record if it was successfully deserialized.
 * @throws IOException if the record could not be read.
 */
public abstract OT readRecord(OT reuse,byte[] bytes,int readOffset,int numBytes) throws IOException ;
Program: 173245
Project: 173245
Buggy source:
/** 
 * Fills the read buffer with bytes read from the file starting from an offset.
 */
private boolean fillBuffer(int offset) throws IOException {
  int maxReadLength=this.readBuffer.length - offset;
  if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
    int read=this.stream.read(this.readBuffer,offset,maxReadLength);
    if (read == -1) {
      this.stream.close();
      this.stream=null;
      return false;
    }
 else {
      this.readPos=offset;
      this.limit=read;
      return true;
    }
  }
  int toRead;
  if (this.splitLength > 0) {
    toRead=this.splitLength > maxReadLength ? maxReadLength : (int)this.splitLength;
  }
 else {
    toRead=maxReadLength;
    this.overLimit=true;
  }
  int read=this.stream.read(this.readBuffer,offset,toRead);
  if (read == -1) {
    this.stream.close();
    this.stream=null;
    return false;
  }
 else {
    this.splitLength-=read;
    this.readPos=offset;
    this.limit=read + offset;
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Fills the read buffer with bytes read from the file starting from an offset.
 */
private boolean fillBuffer(int fillOffset) throws IOException {
  int maxReadLength=this.readBuffer.length - fillOffset;
  if (this.splitLength == FileInputFormat.READ_WHOLE_SPLIT_FLAG) {
    int read=this.stream.read(this.readBuffer,fillOffset,maxReadLength);
    if (read == -1) {
      this.stream.close();
      this.stream=null;
      return false;
    }
 else {
      this.readPos=fillOffset;
      this.limit=read;
      return true;
    }
  }
  int toRead;
  if (this.splitLength > 0) {
    toRead=this.splitLength > maxReadLength ? maxReadLength : (int)this.splitLength;
  }
 else {
    toRead=maxReadLength;
    this.overLimit=true;
  }
  int read=this.stream.read(this.readBuffer,fillOffset,toRead);
  if (read == -1) {
    this.stream.close();
    this.stream=null;
    return false;
  }
 else {
    this.splitLength-=read;
    this.readPos=fillOffset;
    this.limit=read + fillOffset;
    return true;
  }
}
Program: 173246
Project: 173246
Buggy source:
@Override public void execute(){
  LOG.log(Level.INFO,"String_Node_Str");
  for (int i=0; i < 100000; i++) {
    IntData data=generateData();
    while (getDfop().send(0,data)) {
      try {
        Thread.sleep(1);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
    sendCount++;
    Thread.yield();
  }
  status=Status.MAP_FINISHED;
}

Fixed version (ground truth):
@Override public void execute(){
  LOG.log(Level.INFO,"String_Node_Str");
  for (int i=0; i < 100000; i++) {
    IntData data=generateData();
    while (!getDfop().send(0,data)) {
      try {
        Thread.sleep(1);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
    sendCount++;
    Thread.yield();
  }
  status=Status.MAP_FINISHED;
}
Program: 173247
Project: 173247
Buggy source:
/** 
 * Init task executor
 * @param twscom
 * @param dfo
 */
public void init(TWSCommunication twscom,DataFlowOperation dfo){
  this.channel=twscom;
  this.direct=dfo;
  this.progres=true;
}

Fixed version (ground truth):
/** 
 * Init task executor
 */
public void init(TWSCommunication twscom,DataFlowOperation dfo){
  this.channel=twscom;
  this.direct=dfo;
  this.progres=true;
}
Program: 173248
Project: 173248
Buggy source:
/** 
 * Init's the task thread pool
 * @param corePoolSize
 */
private void initThreadPool(int corePoolSize){
  executorPool=(ThreadPoolExecutor)Executors.newFixedThreadPool(corePoolSize);
}

Fixed version (ground truth):
/** 
 * Init's the task thread pool
 */
private void initThreadPool(int corePoolSize){
  executorPool=(ThreadPoolExecutor)Executors.newFixedThreadPool(corePoolSize);
}
Program: 173249
Project: 173249
Buggy source:
public boolean registerQueue(int qid,Queue queue){
  queues.put(qid,queue);
  return true;
}

Fixed version (ground truth):
public boolean registerQueue(int qid,Queue<?> queue){
  queues.put(qid,queue);
  return true;
}
Program: 173250
Project: 173250
Buggy source:
private Node buildIntraGroupTree(int groupId,int index){
  Set<Integer> executorsHostingTask=getExecutorsHostingTask(groupId);
  LOG.log(Level.INFO,taskPlan.getThisExecutor() + "String_Node_Str" + executorsHostingTask);
  List<Integer> executorIds=rotateList(new ArrayList<>(executorsHostingTask),index);
  LOG.log(Level.INFO,taskPlan.getThisExecutor() + "String_Node_Str" + executorIds);
  if (executorIds.size() == 0) {
    return null;
  }
  Collections.sort(executorIds);
  Node rootNode=createTreeeNode(groupId,executorIds.get(0),index);
  Queue<Node> queue=new LinkedList<>();
  Node current=rootNode;
  int i=0;
  while (i < executorIds.size()) {
    if (current.getChildren().size() < intraNodeDegree) {
      Node e=createTreeeNode(groupId,executorIds.get(i),index);
      current.addChild(e);
      e.setParent(current);
      queue.add(e);
      i++;
    }
 else {
      current=queue.poll();
    }
  }
  return rootNode;
}

Fixed version (ground truth):
private Node buildIntraGroupTree(int groupId,int index){
  Set<Integer> executorsHostingTask=getExecutorsHostingTask(groupId);
  List<Integer> executorIds=rotateList(new ArrayList<>(executorsHostingTask),index);
  if (executorIds.size() == 0) {
    return null;
  }
  Collections.sort(executorIds);
  Node rootNode=createTreeeNode(groupId,executorIds.get(0),index);
  Queue<Node> queue=new LinkedList<>();
  Node current=rootNode;
  int i=1;
  while (i < executorIds.size()) {
    if (current.getChildren().size() < intraNodeDegree) {
      Node e=createTreeeNode(groupId,executorIds.get(i),index);
      current.addChild(e);
      e.setParent(current);
      LOG.info(String.format("String_Node_Str",taskPlan.getThisExecutor(),e,current));
      queue.add(e);
      i++;
    }
 else {
      current=queue.poll();
    }
  }
  return rootNode;
}
Program: 173251
Project: 173251
Buggy source:
private Node createTreeeNode(int groupId,int executorId,int rotateIndex){
  Set<Integer> allTasksOfExecutor=taskPlan.getChannelsOfExecutor(executorId);
  if (allTasksOfExecutor == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Set<Integer> tasksOfExecutor=getTasksInExecutor(executorId);
  if (tasksOfExecutor == null) {
    throw new RuntimeException("String_Node_Str");
  }
  LOG.info(String.format("String_Node_Str",taskPlan.getThisExecutor(),allTasksOfExecutor.toString(),tasksOfExecutor.toString()));
  List<Integer> channelsOfExecutorList=new ArrayList<>(tasksOfExecutor);
  Collections.sort(channelsOfExecutorList);
  channelsOfExecutorList=rotateList(channelsOfExecutorList,rotateIndex);
  int firstTaskId=channelsOfExecutorList.get(0);
  Node node=new Node(firstTaskId,groupId);
  for (int i=1; i < channelsOfExecutorList.size(); i++) {
    node.addDirectChild(channelsOfExecutorList.get(i));
  }
  LOG.info(String.format("String_Node_Str",taskPlan.getThisExecutor(),node));
  return node;
}

Fixed version (ground truth):
private Node createTreeeNode(int groupId,int executorId,int rotateIndex){
  Set<Integer> allTasksOfExecutor=taskPlan.getChannelsOfExecutor(executorId);
  if (allTasksOfExecutor == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Set<Integer> tasksOfExecutor=getTasksInExecutor(executorId);
  if (tasksOfExecutor == null) {
    throw new RuntimeException("String_Node_Str");
  }
  LOG.info(String.format("String_Node_Str",taskPlan.getThisExecutor(),allTasksOfExecutor.toString(),tasksOfExecutor.toString()));
  List<Integer> channelsOfExecutorList=new ArrayList<>(tasksOfExecutor);
  Collections.sort(channelsOfExecutorList);
  channelsOfExecutorList=rotateList(channelsOfExecutorList,rotateIndex);
  int firstTaskId=channelsOfExecutorList.get(0);
  Node node=new Node(firstTaskId,groupId);
  for (int i=1; i < channelsOfExecutorList.size(); i++) {
    node.addDirectChild(channelsOfExecutorList.get(i));
  }
  return node;
}
Program: 173253
Project: 173253
Buggy source:
@Override public void onMessage(int source,int path,int target,Object object){
}

Fixed version (ground truth):
@Override public void onMessage(int source,int path,int target,Object object){
  LOG.info("String_Node_Str");
}
Program: 173254
Project: 173254
Buggy source:
public static int receiveBufferCount(Config cfg){
  return cfg.getIntegerValue(RECEIVE_BUFFERS_COUNT,64);
}

Fixed version (ground truth):
public static int receiveBufferCount(Config cfg){
  return cfg.getIntegerValue(RECEIVE_BUFFERS_COUNT,128);
}
Program: 173255
Project: 173255
Buggy source:
public static int sendBuffersCount(Config cfg){
  return cfg.getIntegerValue(SEND_BUFFERS_COUNT,4);
}

Fixed version (ground truth):
public static int sendBuffersCount(Config cfg){
  return cfg.getIntegerValue(SEND_BUFFERS_COUNT,128);
}
Program: 173256
Project: 173256
Buggy source:
protected void releaseTheBuffers(int id,MPIMessage message){
  if (MPIMessageDirection.IN == message.getMessageDirection()) {
    List<MPIBuffer> list=receiveBuffers.get(id);
    for (    MPIBuffer buffer : message.getBuffers()) {
      list.add(buffer);
    }
  }
 else   if (MPIMessageDirection.OUT == message.getMessageDirection()) {
    Queue<MPIBuffer> queue=sendBuffers;
    for (    MPIBuffer buffer : message.getBuffers()) {
      queue.offer(buffer);
    }
  }
}

Fixed version (ground truth):
protected void releaseTheBuffers(int id,MPIMessage message){
  if (MPIMessageDirection.IN == message.getMessageDirection()) {
    List<MPIBuffer> list=receiveBuffers.get(id);
    for (    MPIBuffer buffer : message.getBuffers()) {
      buffer.getByteBuffer().reset();
      list.add(buffer);
    }
  }
 else   if (MPIMessageDirection.OUT == message.getMessageDirection()) {
    Queue<MPIBuffer> queue=sendBuffers;
    for (    MPIBuffer buffer : message.getBuffers()) {
      LOG.info("String_Node_Str");
      buffer.getByteBuffer().clear();
      queue.offer(buffer);
    }
  }
}
Program: 173257
Project: 173257
Buggy source:
/** 
 * Send a message to the given rank.
 * @param requests the message
 */
private void postMessage(MPISendRequests requests){
  MPIMessage message=requests.message;
  for (int i=0; i < message.getBuffers().size(); i++) {
    try {
      MPIBuffer buffer=message.getBuffers().get(i);
      LOG.info(String.format("String_Node_Str",executor,requests.rank,buffer.getSize()));
      Request request=comm.iSend(buffer.getByteBuffer(),buffer.getSize(),MPI.BYTE,requests.rank,message.getHeader().getEdge());
      requests.pendingSends.add(new MPIRequest(request,buffer));
    }
 catch (    MPIException e) {
      throw new RuntimeException("String_Node_Str" + requests.rank);
    }
  }
}

Fixed version (ground truth):
/** 
 * Send a message to the given rank.
 * @param requests the message
 */
private void postMessage(MPISendRequests requests){
  MPIMessage message=requests.message;
  for (int i=0; i < message.getBuffers().size(); i++) {
    try {
      sendCount++;
      MPIBuffer buffer=message.getBuffers().get(i);
      LOG.info(String.format("String_Node_Str",executor,requests.rank,buffer.getSize(),sendCount));
      Request request=comm.iSend(buffer.getByteBuffer(),buffer.getSize(),MPI.BYTE,requests.rank,message.getHeader().getEdge());
      requests.pendingSends.add(new MPIRequest(request,buffer));
    }
 catch (    MPIException e) {
      throw new RuntimeException("String_Node_Str" + requests.rank);
    }
  }
}