nus-yam/ex-repair huggingface dataset:
Program: 24482
Project: 24482
Buggy source:
public DebugConfig(){
  verticesToDebugSet=null;
  debugAllVertices=false;
  debugNeighborsOfVerticesToDebug=false;
  superstepsToDebugSet=null;
}

Fixed version (ground truth):
/** 
 * Default public constructor. Configures not to debug any vertex in any superstep. But below {#link   {@link #shouldCatchExceptions()} returnstrue by default, so configures Graft to only catch exceptions.
 */
public DebugConfig(){
  verticesToDebugSet=null;
  debugAllVertices=false;
  debugNeighborsOfVerticesToDebug=false;
  superstepsToDebugSet=null;
}
Program: 24483
Project: 24483
Buggy source:
public boolean shouldCatchExceptions(){
  return true;
}

Fixed version (ground truth):
/** 
 * @return whether exceptions should be caught.
 */
public boolean shouldCatchExceptions(){
  return true;
}
Program: 24484
Project: 24484
Buggy source:
/** 
 * Propagates the smallest vertex id to all neighbors. Will always choose to halt and only reactivate if a smaller id has been sent to it.
 * @param vertex Vertex
 * @param messages Iterator of messages from the previous superstep.
 * @throws IOException
 */
@Override public void compute(Vertex<IntWritable,IntWritable,NullWritable> vertex,Iterable<IntWritable> messages) throws IOException {
  int currentComponent=vertex.getValue().get();
  if (getSuperstep() == 0) {
    vertex.setValue(new IntWritable(currentComponent));
    for (    Edge<IntWritable,NullWritable> edge : vertex.getEdges()) {
      sendMessage(edge.getTargetVertexId(),vertex.getValue());
    }
    vertex.voteToHalt();
    return;
  }
  boolean changed=false;
  for (  IntWritable message : messages) {
    int candidateComponent=message.get();
    if (candidateComponent > currentComponent) {
      System.out.println("String_Node_Str" + getSuperstep() + "String_Node_Str"+ vertex.getId()+ "String_Node_Str"+ candidateComponent);
      currentComponent=candidateComponent;
      changed=true;
    }
  }
  if (changed) {
    vertex.setValue(new IntWritable(currentComponent));
    for (    Edge<IntWritable,NullWritable> edge : vertex.getEdges()) {
      sendMessage(edge.getTargetVertexId(),vertex.getValue());
    }
  }
  vertex.voteToHalt();
}

Fixed version (ground truth):
/** 
 * Propagates the smallest vertex id to all neighbors. Will always choose to halt and only reactivate if a smaller id has been sent to it.
 * @param vertex Vertex
 * @param messages Iterator of messages from the previous superstep.
 * @throws IOException
 */
@Override public void compute(Vertex<IntWritable,IntWritable,NullWritable> vertex,Iterable<IntWritable> messages) throws IOException {
  int currentComponent=vertex.getValue().get();
  if (getSuperstep() == 0) {
    vertex.setValue(new IntWritable(currentComponent));
    for (    Edge<IntWritable,NullWritable> edge : vertex.getEdges()) {
      sendMessage(edge.getTargetVertexId(),vertex.getValue());
    }
    vertex.voteToHalt();
    return;
  }
  boolean changed=false;
  for (  IntWritable message : messages) {
    int candidateComponent=message.get();
    if (candidateComponent > currentComponent) {
      System.out.print("String_Node_Str" + getSuperstep() + "String_Node_Str"+ vertex.getId()+ "String_Node_Str"+ candidateComponent+ "String_Node_Str");
      currentComponent=candidateComponent;
      changed=true;
    }
  }
  if (changed) {
    vertex.setValue(new IntWritable(currentComponent));
    for (    Edge<IntWritable,NullWritable> edge : vertex.getEdges()) {
      sendMessage(edge.getTargetVertexId(),vertex.getValue());
    }
  }
  vertex.voteToHalt();
}
Program: 24485
Project: 24485
Buggy source:
@Override public void compute(Vertex<LongWritable,DoubleWritable,FloatWritable> vertex,Iterable<DoubleWritable> messages) throws IOException {
  LongWritable aggregatedValue=getAggregatedValue(SimpleShortestPathsMaster.NV_DISTANCE_LESS_THAN_THREE_AGGREGATOR);
  if (aggregatedValue != null) {
    System.out.println("String_Node_Str" + aggregatedValue.get());
  }
  if (getSuperstep() == 0) {
    vertex.setValue(new DoubleWritable(isSource(vertex) ? 0d : Double.MAX_VALUE));
  }
  double previousValue=vertex.getValue().get();
  double minDist=previousValue;
  for (  DoubleWritable message : messages) {
    minDist=Math.min(minDist,message.get());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + vertex.getId() + "String_Node_Str"+ minDist+ "String_Node_Str"+ vertex.getValue());
  }
  if (minDist < vertex.getValue().get() || getSuperstep() == 0 && minDist == 0) {
    vertex.setValue(new DoubleWritable(minDist));
    for (    Edge<LongWritable,FloatWritable> edge : vertex.getEdges()) {
      double distance=minDist + edge.getValue().get();
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + vertex.getId() + "String_Node_Str"+ edge.getTargetVertexId()+ "String_Node_Str"+ distance);
      }
      sendMessage(edge.getTargetVertexId(),new DoubleWritable(minDist));
    }
  }
  if (previousValue > 3 && minDist <= 3) {
    aggregate(SimpleShortestPathsMaster.NV_DISTANCE_LESS_THAN_THREE_AGGREGATOR,new LongWritable(1));
  }
  vertex.voteToHalt();
}

Fixed version (ground truth):
@Override public void compute(Vertex<LongWritable,DoubleWritable,FloatWritable> vertex,Iterable<DoubleWritable> messages) throws IOException {
  LongWritable aggregatedValue=getAggregatedValue(SimpleShortestPathsMaster.NV_DISTANCE_LESS_THAN_THREE_AGGREGATOR);
  if (aggregatedValue != null) {
    System.out.print("String_Node_Str" + aggregatedValue.get() + "String_Node_Str");
  }
  if (getSuperstep() == 0) {
    vertex.setValue(new DoubleWritable(isSource(vertex) ? 0d : Double.MAX_VALUE));
  }
  double previousValue=vertex.getValue().get();
  double minDist=previousValue;
  for (  DoubleWritable message : messages) {
    minDist=Math.min(minDist,message.get());
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("String_Node_Str" + vertex.getId() + "String_Node_Str"+ minDist+ "String_Node_Str"+ vertex.getValue());
  }
  if (minDist < vertex.getValue().get() || getSuperstep() == 0 && minDist == 0) {
    vertex.setValue(new DoubleWritable(minDist));
    for (    Edge<LongWritable,FloatWritable> edge : vertex.getEdges()) {
      double distance=minDist + edge.getValue().get();
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + vertex.getId() + "String_Node_Str"+ edge.getTargetVertexId()+ "String_Node_Str"+ distance);
      }
      sendMessage(edge.getTargetVertexId(),new DoubleWritable(minDist));
    }
  }
  if (previousValue > 3 && minDist <= 3) {
    aggregate(SimpleShortestPathsMaster.NV_DISTANCE_LESS_THAN_THREE_AGGREGATOR,new LongWritable(1));
  }
  vertex.voteToHalt();
}
Program: 24486
Project: 24486
Buggy source:
private void interceptMessageAndCheckIntegrityIfNecessary(I id,M2 message){
  if (debugConfig.shouldCheckMessageIntegrity() && !debugConfig.isMessageCorrect(id,vertexId,message) && numMessageViolationsLogged < NUM_VIOLATIONS_TO_LOG) {
    msgIntegrityViolationWrapper.addMsgWrapper(vertexId,id,message);
    hasViolatedMsgValueConstraint=true;
    numMessageViolationsLogged++;
  }
}

Fixed version (ground truth):
private void interceptMessageAndCheckIntegrityIfNecessary(I id,M2 message){
  if (debugConfig.shouldCheckMessageIntegrity() && !debugConfig.isMessageCorrect(vertexId,id,message) && numMessageViolationsLogged < NUM_VIOLATIONS_TO_LOG) {
    msgIntegrityViolationWrapper.addMsgWrapper(vertexId,id,message);
    hasViolatedMsgValueConstraint=true;
    numMessageViolationsLogged++;
  }
}
Program: 24487
Project: 24487
Buggy source:
final protected void interceptPostSuperstepEnd(){
  if (debugConfig.shouldCheckMessageIntegrity() && msgIntegrityViolationWrapper.numMsgWrappers() > 0) {
    commonVertexMasterInterceptionUtil.saveScenarioWrapper(msgIntegrityViolationWrapper,DebuggerUtils.getMessageIntegrityAllTraceFullFileName(getSuperstep(),commonVertexMasterInterceptionUtil.getJobId(),getContext().getTaskAttemptID().getTaskID().getId()));
  }
}

Fixed version (ground truth):
final protected void interceptPostSuperstepEnd(){
  if (debugConfig.shouldCheckMessageIntegrity() && msgIntegrityViolationWrapper.numMsgWrappers() > 0) {
    commonVertexMasterInterceptionUtil.saveScenarioWrapper(msgIntegrityViolationWrapper,DebuggerUtils.getMessageIntegrityAllTraceFullFileName(getSuperstep(),commonVertexMasterInterceptionUtil.getJobId(),UUID.randomUUID().toString()));
  }
}
Program: 24488
Project: 24488
Buggy source:
/** 
 * A convenience method around  {@link #getFullTraceFileName(DebugTrace,String,Long,String,Integer)}.
 */
public static String getMessageIntegrityAllTraceFullFileName(long superstepNo,String jobId,int taskId){
  return getFullTraceFileName(DebugTrace.INTEGRITY_MESSAGE_ALL,jobId,superstepNo,null,taskId);
}

Fixed version (ground truth):
/** 
 * A convenience method around  {@link #getFullTraceFileName(DebugTrace,String,Long,String,Integer)}.
 */
public static String getMessageIntegrityAllTraceFullFileName(long superstepNo,String jobId,String taskId){
  return getFullTraceFileName(DebugTrace.INTEGRITY_MESSAGE_ALL,jobId,superstepNo,null,taskId);
}
Program: 24489
Project: 24489
Buggy source:
private static String getTraceFileName(DebugTrace debugTrace,Long superstepNo,String vertexId,Integer taskId){
  String format=getTraceFileFormat(debugTrace);
switch (debugTrace) {
case VERTEX_REGULAR:
    return String.format(format,superstepNo,vertexId);
case VERTEX_EXCEPTION:
  return String.format(format,superstepNo,vertexId);
case INTEGRITY_MESSAGE_ALL:
return String.format(format,taskId,superstepNo);
case INTEGRITY_MESSAGE_SINGLE_VERTEX:
return String.format(format,superstepNo,vertexId);
case INTEGRITY_VERTEX:
return String.format(format,superstepNo,vertexId);
case MASTER_REGULAR:
return String.format(format,superstepNo);
case MASTER_EXCEPTION:
return String.format(format,superstepNo);
default :
return null;
}
}

Fixed version (ground truth):
private static String getTraceFileName(DebugTrace debugTrace,Long superstepNo,String vertexId,String taskId){
  String format=getTraceFileFormat(debugTrace);
switch (debugTrace) {
case VERTEX_REGULAR:
    return String.format(format,superstepNo,vertexId);
case VERTEX_EXCEPTION:
  return String.format(format,superstepNo,vertexId);
case INTEGRITY_MESSAGE_ALL:
return String.format(format,taskId,superstepNo);
case INTEGRITY_MESSAGE_SINGLE_VERTEX:
return String.format(format,superstepNo,vertexId);
case INTEGRITY_VERTEX:
return String.format(format,superstepNo,vertexId);
case MASTER_REGULAR:
return String.format(format,superstepNo);
case MASTER_EXCEPTION:
return String.format(format,superstepNo);
default :
return null;
}
}
Program: 24490
Project: 24490
Buggy source:
public static GiraphMasterScenarioWrapper readMasterScenarioFromTrace(String jobId,long superstepNo,DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (!EnumSet.of(DebugTrace.MASTER_ALL,DebugTrace.MASTER_EXCEPTION,DebugTrace.MASTER_REGULAR).contains(debugTrace)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  FileSystem fs=ServerUtils.getFileSystem();
  GiraphMasterScenarioWrapper giraphScenarioWrapper=new GiraphMasterScenarioWrapper();
  if (debugTrace == DebugTrace.MASTER_REGULAR || debugTrace == DebugTrace.MASTER_ALL) {
    String traceFilePath=ServerUtils.getMasterTraceFilePath(jobId,superstepNo,DebugTrace.MASTER_REGULAR);
    try {
      giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath);
      return giraphScenarioWrapper;
    }
 catch (    FileNotFoundException e) {
      if (debugTrace == DebugTrace.MASTER_ALL) {
        Debug.println("String_Node_Str","String_Node_Str");
      }
 else {
        throw e;
      }
    }
  }
  String traceFilePath=ServerUtils.getMasterTraceFilePath(jobId,superstepNo,DebugTrace.MASTER_EXCEPTION);
  giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath);
  return giraphScenarioWrapper;
}

Fixed version (ground truth):
public static GiraphMasterScenarioWrapper readMasterScenarioFromTrace(String jobId,long superstepNo,DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (!EnumSet.of(DebugTrace.MASTER_ALL,DebugTrace.MASTER_EXCEPTION,DebugTrace.MASTER_REGULAR).contains(debugTrace)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  FileSystem fs=ServerUtils.getFileSystem();
  GiraphMasterScenarioWrapper giraphScenarioWrapper=new GiraphMasterScenarioWrapper();
  if (debugTrace == DebugTrace.MASTER_REGULAR || debugTrace == DebugTrace.MASTER_ALL) {
    String traceFilePath=ServerUtils.getMasterTraceFilePath(jobId,superstepNo,DebugTrace.MASTER_REGULAR);
    try {
      giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
      return giraphScenarioWrapper;
    }
 catch (    FileNotFoundException e) {
      if (debugTrace == DebugTrace.MASTER_ALL) {
        Debug.println("String_Node_Str","String_Node_Str");
      }
 else {
        throw e;
      }
    }
  }
  String traceFilePath=ServerUtils.getMasterTraceFilePath(jobId,superstepNo,DebugTrace.MASTER_EXCEPTION);
  giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
  return giraphScenarioWrapper;
}
Program: 24491
Project: 24491
Buggy source:
public static String getTraceFileRoot(String jobId,DebugTrace debugTrace){
switch (debugTrace) {
case VERTEX_REGULAR:
case VERTEX_EXCEPTION:
case VERTEX_ALL:
case INTEGRITY_MESSAGE:
case INTEGRITY_VERTEX:
case MASTER_REGULAR:
case MASTER_EXCEPTION:
case MASTER_ALL:
    return String.format("String_Node_Str",ServerUtils.TRACE_ROOT,jobId);
default :
  throw new IllegalArgumentException("String_Node_Str");
}
}

Fixed version (ground truth):
public static String getTraceFileRoot(String jobId,DebugTrace debugTrace){
switch (debugTrace) {
case VERTEX_REGULAR:
case VERTEX_EXCEPTION:
case VERTEX_ALL:
case INTEGRITY_MESSAGE:
case INTEGRITY_VERTEX:
case MASTER_REGULAR:
case MASTER_EXCEPTION:
case MASTER_ALL:
case JAR_SIGNATURE:
    return String.format("String_Node_Str",ServerUtils.TRACE_ROOT,jobId);
default :
  throw new IllegalArgumentException("String_Node_Str");
}
}
Program: 24492
Project: 24492
Buggy source:
public static String getCachedJobJarPath(String jobId){
  return null;
}

Fixed version (ground truth):
public static URL getCachedJobJarPath(String jobId) throws IOException {
  Path jarSignaturePath=new Path(getTraceFileRoot(jobId,DebugTrace.JAR_SIGNATURE) + "String_Node_Str" + "String_Node_Str");
  FileSystem fs=getFileSystem();
  String jarSignature=IOUtils.readLines(fs.open(jarSignaturePath)).get(0);
  File localFile=new File(JARCACHE_LOCAL + "String_Node_Str" + jarSignature+ "String_Node_Str");
  if (!localFile.exists()) {
    Path hdfsPath=new Path(fs.getUri().resolve(JARCACHE_HDFS + "String_Node_Str" + jarSignature+ "String_Node_Str"));
    Logger.getLogger(ServerUtils.class).info("String_Node_Str" + hdfsPath + "String_Node_Str"+ localFile);
    localFile.getParentFile().mkdirs();
    fs.copyToLocalFile(hdfsPath,new Path(localFile.toURI()));
  }
  return localFile.toURI().toURL();
}
Program: 24493
Project: 24493
Buggy source:
public static GiraphVertexScenarioWrapper readScenarioFromTrace(String jobId,long superstepNo,String vertexId,DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (!EnumSet.of(DebugTrace.VERTEX_ALL,DebugTrace.VERTEX_EXCEPTION,DebugTrace.VERTEX_REGULAR).contains(debugTrace)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  FileSystem fs=ServerUtils.getFileSystem();
  GiraphVertexScenarioWrapper giraphScenarioWrapper=new GiraphVertexScenarioWrapper();
  if (debugTrace == DebugTrace.VERTEX_REGULAR || debugTrace == DebugTrace.VERTEX_ALL) {
    String traceFilePath=ServerUtils.getVertexTraceFilePath(jobId,superstepNo,vertexId,DebugTrace.VERTEX_REGULAR);
    try {
      giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath);
      return giraphScenarioWrapper;
    }
 catch (    FileNotFoundException e) {
      if (debugTrace == DebugTrace.VERTEX_ALL) {
        Debug.println("String_Node_Str","String_Node_Str");
      }
 else {
        throw e;
      }
    }
  }
  String traceFilePath=ServerUtils.getVertexTraceFilePath(jobId,superstepNo,vertexId,DebugTrace.VERTEX_EXCEPTION);
  giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath);
  return giraphScenarioWrapper;
}

Fixed version (ground truth):
public static GiraphVertexScenarioWrapper readScenarioFromTrace(String jobId,long superstepNo,String vertexId,DebugTrace debugTrace) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (!EnumSet.of(DebugTrace.VERTEX_ALL,DebugTrace.VERTEX_EXCEPTION,DebugTrace.VERTEX_REGULAR).contains(debugTrace)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  FileSystem fs=ServerUtils.getFileSystem();
  GiraphVertexScenarioWrapper giraphScenarioWrapper=new GiraphVertexScenarioWrapper();
  if (debugTrace == DebugTrace.VERTEX_REGULAR || debugTrace == DebugTrace.VERTEX_ALL) {
    String traceFilePath=ServerUtils.getVertexTraceFilePath(jobId,superstepNo,vertexId,DebugTrace.VERTEX_REGULAR);
    try {
      giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
      return giraphScenarioWrapper;
    }
 catch (    FileNotFoundException e) {
      if (debugTrace == DebugTrace.VERTEX_ALL) {
        Debug.println("String_Node_Str","String_Node_Str");
      }
 else {
        throw e;
      }
    }
  }
  String traceFilePath=ServerUtils.getVertexTraceFilePath(jobId,superstepNo,vertexId,DebugTrace.VERTEX_EXCEPTION);
  giraphScenarioWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
  return giraphScenarioWrapper;
}
Program: 24494
Project: 24494
Buggy source:
public static VertexValueIntegrityViolationWrapper readVertexIntegrityViolationFromTrace(String jobId,String taskId,long superstepNo) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getIntegrityTraceFilePath(jobId,taskId,superstepNo,DebugTrace.INTEGRITY_VERTEX);
  VertexValueIntegrityViolationWrapper vertexValueIntegrityViolationWrapper=new VertexValueIntegrityViolationWrapper();
  vertexValueIntegrityViolationWrapper.loadFromHDFS(fs,traceFilePath);
  return vertexValueIntegrityViolationWrapper;
}

Fixed version (ground truth):
public static VertexValueIntegrityViolationWrapper readVertexIntegrityViolationFromTrace(String jobId,String taskId,long superstepNo) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getIntegrityTraceFilePath(jobId,taskId,superstepNo,DebugTrace.INTEGRITY_VERTEX);
  VertexValueIntegrityViolationWrapper vertexValueIntegrityViolationWrapper=new VertexValueIntegrityViolationWrapper();
  vertexValueIntegrityViolationWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
  return vertexValueIntegrityViolationWrapper;
}
Program: 24495
Project: 24495
Buggy source:
public static MsgIntegrityViolationWrapper readMsgIntegrityViolationFromTrace(String jobId,String taskId,long superstepNo) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getIntegrityTraceFilePath(jobId,taskId,superstepNo,DebugTrace.INTEGRITY_MESSAGE);
  MsgIntegrityViolationWrapper msgIntegrityViolationWrapper=new MsgIntegrityViolationWrapper();
  msgIntegrityViolationWrapper.loadFromHDFS(fs,traceFilePath);
  return msgIntegrityViolationWrapper;
}

Fixed version (ground truth):
public static MsgIntegrityViolationWrapper readMsgIntegrityViolationFromTrace(String jobId,String taskId,long superstepNo) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getIntegrityTraceFilePath(jobId,taskId,superstepNo,DebugTrace.INTEGRITY_MESSAGE);
  MsgIntegrityViolationWrapper msgIntegrityViolationWrapper=new MsgIntegrityViolationWrapper();
  msgIntegrityViolationWrapper.loadFromHDFS(fs,traceFilePath,getCachedJobJarPath(jobId));
  return msgIntegrityViolationWrapper;
}
Program: 24496
Project: 24496
Buggy source:
public void loadFromHDFS(FileSystem fs,String fileName) throws ClassNotFoundException, IOException, InstantiationException, IllegalAccessException {
  loadFromProto(parseProtoFromInputStream(fs.open(new Path(fileName))));
}

Fixed version (ground truth):
/** 
 * Add given URLs to the CLASSPATH before loading from HDFS. To do so, we hack the system class loader, assuming it is an URLClassLoader. XXX Setting the currentThread's context class loader has no effect on Class#forName().
 * @see http://stackoverflow.com/a/12963811/390044
 * @param fs
 * @param fileName
 * @param classPaths
 * @throws ClassNotFoundException
 * @throws InstantiationException
 * @throws IllegalAccessException
 * @throws IOException
 */
public void loadFromHDFS(FileSystem fs,String fileName,URL... classPaths) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException {
  for (  URL url : classPaths)   addPath(url);
  loadFromHDFS(fs,fileName);
}
Program: 24497
Project: 24497
Buggy source:
final protected void interceptInitializeEnd(){
  commonVertexMasterInterceptionUtil=new CommonVertexMasterInterceptionUtil(getContext().getJobID().toString());
  String debugConfigFileName=DEBUG_CONFIG_CLASS.get(getConf());
  LOG.info("String_Node_Str" + debugConfigFileName);
  Class<?> clazz;
  try {
    clazz=Class.forName(debugConfigFileName);
    debugConfig=(DebugConfig<I,V,E,M1,M2>)clazz.newInstance();
    debugConfig.readConfig(getConf());
    LOG.info("String_Node_Str" + debugConfigFileName);
    vertexIdClazz=getConf().getVertexIdClass();
    vertexValueClazz=getConf().getVertexValueClass();
    edgeValueClazz=getConf().getEdgeValueClass();
    incomingMessageClazz=getConf().getIncomingMessageValueClass();
    outgoingMessageClazz=getConf().getOutgoingMessageValueClass();
  }
 catch (  InstantiationException|ClassNotFoundException|IllegalAccessException e) {
    LOG.error("String_Node_Str" + debugConfigFileName);
    e.printStackTrace();
    throw new RuntimeException(e);
  }
  String jarSignature=getConf().get(JAR_SIGNATURE_KEY);
  if (jarSignature != null) {
    FileSystem fs=CommonVertexMasterInterceptionUtil.getFileSystem();
    Path jarSignaturePath=new Path(commonVertexMasterInterceptionUtil.getTraceDirectory() + "String_Node_Str" + "String_Node_Str");
    try {
      if (!fs.exists(jarSignaturePath)) {
        OutputStream f=fs.create(jarSignaturePath,true).getWrappedStream();
        IOUtils.write(jarSignature,f);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
final protected void interceptInitializeEnd(){
  commonVertexMasterInterceptionUtil=new CommonVertexMasterInterceptionUtil(getContext().getJobID().toString());
  String debugConfigFileName=DEBUG_CONFIG_CLASS.get(getConf());
  LOG.info("String_Node_Str" + debugConfigFileName);
  Class<?> clazz;
  try {
    clazz=Class.forName(debugConfigFileName);
    debugConfig=(DebugConfig<I,V,E,M1,M2>)clazz.newInstance();
    debugConfig.readConfig(getConf());
    LOG.info("String_Node_Str" + debugConfigFileName);
    vertexIdClazz=getConf().getVertexIdClass();
    vertexValueClazz=getConf().getVertexValueClass();
    edgeValueClazz=getConf().getEdgeValueClass();
    incomingMessageClazz=getConf().getIncomingMessageValueClass();
    outgoingMessageClazz=getConf().getOutgoingMessageValueClass();
  }
 catch (  InstantiationException|ClassNotFoundException|IllegalAccessException e) {
    LOG.error("String_Node_Str" + debugConfigFileName);
    e.printStackTrace();
    throw new RuntimeException(e);
  }
  String jarSignature=getConf().get(JAR_SIGNATURE_KEY);
  if (jarSignature != null) {
    FileSystem fs=CommonVertexMasterInterceptionUtil.getFileSystem();
    Path jarSignaturePath=new Path(commonVertexMasterInterceptionUtil.getTraceDirectory() + "String_Node_Str" + "String_Node_Str");
    try {
      if (!fs.exists(jarSignaturePath)) {
        OutputStream f=fs.create(jarSignaturePath,true).getWrappedStream();
        IOUtils.write(jarSignature,f);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 24498
Project: 24498
Buggy source:
@Override public GeneratedMessage buildProtoObject(){
  Exception.Builder exceptionBuilder=Exception.newBuilder();
  exceptionBuilder.setMessage(errorMessage);
  exceptionBuilder.setStackTrace(stackTrace);
  return exceptionBuilder.build();
}

Fixed version (ground truth):
@Override public GeneratedMessage buildProtoObject(){
  Exception.Builder exceptionBuilder=Exception.newBuilder();
  exceptionBuilder.setMessage(getErrorMessage());
  exceptionBuilder.setStackTrace(getStackTrace());
  return exceptionBuilder.build();
}
Program: 24499
Project: 24499
Buggy source:
public void setErrorMessage(String errorMessage){
  this.errorMessage=errorMessage;
}

Fixed version (ground truth):
public void setErrorMessage(String errorMessage){
  this.errorMessage="String_Node_Str" + errorMessage;
}
Program: 24500
Project: 24500
Buggy source:
public void setStackTrace(String stackTrace){
  this.stackTrace=stackTrace;
}

Fixed version (ground truth):
public void setStackTrace(String stackTrace){
  this.stackTrace="String_Node_Str" + stackTrace;
}
Program: 24502
Project: 24502
Buggy source:
private void setMandatoryResponseHeaders(){
  Headers headers=this.httpExchange.getResponseHeaders();
  headers.add("String_Node_Str","String_Node_Str");
  headers.add("String_Node_Str",this.responseMimeType);
}

Fixed version (ground truth):
private void setMandatoryResponseHeaders(){
  Headers headers=this.httpExchange.getResponseHeaders();
  headers.add("String_Node_Str","String_Node_Str");
  headers.add("String_Node_Str",this.responseContentType);
}
Program: 24503
Project: 24503
Buggy source:
public void handle(HttpExchange httpExchange) throws IOException {
  this.httpExchange=httpExchange;
  this.setResponseMimeType();
  String rawUrl=httpExchange.getRequestURI().getQuery();
  HashMap<String,String> paramMap;
  int statusCode;
  try {
    paramMap=ServerUtils.getUrlParams(rawUrl);
    processRequest(httpExchange,paramMap);
  }
 catch (  UnsupportedEncodingException ex) {
    this.statusCode=HttpURLConnection.HTTP_BAD_REQUEST;
    this.response="String_Node_Str";
  }
  if (this.statusCode != HttpURLConnection.HTTP_OK) {
    this.responseMimeType=MediaType.TEXT_PLAIN;
  }
  this.setMandatoryResponseHeaders();
  if (this.responseMimeType == MediaType.APPLICATION_JSON || this.statusCode != HttpURLConnection.HTTP_OK) {
    this.writeTextResponse();
  }
 else {
    this.writeByteResponse();
  }
}

Fixed version (ground truth):
public void handle(HttpExchange httpExchange) throws IOException {
  this.httpExchange=httpExchange;
  this.responseContentType=MediaType.APPLICATION_JSON;
  String rawUrl=httpExchange.getRequestURI().getQuery();
  HashMap<String,String> paramMap;
  int statusCode;
  try {
    paramMap=ServerUtils.getUrlParams(rawUrl);
    processRequest(httpExchange,paramMap);
  }
 catch (  UnsupportedEncodingException ex) {
    this.statusCode=HttpURLConnection.HTTP_BAD_REQUEST;
    this.response="String_Node_Str";
  }
  if (this.statusCode != HttpURLConnection.HTTP_OK) {
    this.responseContentType=MediaType.TEXT_PLAIN;
  }
  this.setMandatoryResponseHeaders();
  this.writeResponse();
}
Program: 24504
Project: 24504
Buggy source:
public static GiraphScenarioWrapper readScenarioFromTrace(String jobId,long superstepNo,String vertexId) throws IOException, ClassNotFoundException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=String.format("String_Node_Str",jobId,superstepNo,vertexId);
  GiraphScenearioSaverLoader giraphSaverLoader=new GiraphScenearioSaverLoader<>();
  GiraphScenarioWrapper giraphScenarioWrapper=giraphSaverLoader.loadFromHDFS(fs,traceFilePath);
  return giraphScenarioWrapper;
}

Fixed version (ground truth):
public static GiraphScenarioWrapper readScenarioFromTrace(String jobId,long superstepNo,String vertexId) throws IOException, ClassNotFoundException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getTraceFilePath(jobId,superstepNo,vertexId);
  GiraphScenearioSaverLoader giraphSaverLoader=new GiraphScenearioSaverLoader<>();
  GiraphScenarioWrapper giraphScenarioWrapper=giraphSaverLoader.loadFromHDFS(fs,traceFilePath);
  return giraphScenarioWrapper;
}
Program: 24505
Project: 24505
Buggy source:
public static byte[] readTrace(String jobId,long superstepNo,String vertexId) throws IOException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=String.format("String_Node_Str",jobId,superstepNo,vertexId);
  byte[] data=IOUtils.toByteArray(fs.open(new Path(traceFilePath)));
  return data;
}

Fixed version (ground truth):
public static byte[] readTrace(String jobId,long superstepNo,String vertexId) throws IOException {
  FileSystem fs=ServerUtils.getFileSystem();
  String traceFilePath=ServerUtils.getTraceFilePath(jobId,superstepNo,vertexId);
  byte[] data=IOUtils.toByteArray(fs.open(new Path(traceFilePath)));
  return data;
}
Program: 24506
Project: 24506
Buggy source:
/** 
 * Is this vertex the source id?
 * @param vertex Vertex
 * @return True if the source id
 */
private boolean isSource(Vertex<LongWritable,?,?> vertex){
  return vertex.getId().get() == 0;
}

Fixed version (ground truth):
/** 
 * Is this vertex the source id?
 * @param vertex Vertex
 * @return True if the source id
 */
private boolean isSource(Vertex<LongWritable,?,?> vertex){
  return vertex.getId().get() == SOURCE_ID.get(getConf());
}
Program: 24507
Project: 24507
Buggy source:
public void compute(Vertex<I,V,E> vertex,Iterable<M1> messages) throws IOException {
  shouldDebugVertex=debugConfig.shouldDebugSuperstep(getSuperstep()) && debugConfig.shouldDebugVertex(vertex.getId());
  if (shouldDebugVertex) {
    initGiraphScenario();
    debugVertexBeforeComputation(vertex,messages);
  }
  computeFurther(vertex,messages);
  if (shouldDebugVertex) {
    giraphScenarioWrapper.getContextWrapper().setVertexValueAfterWrapper(vertex.getValue());
    new GiraphScenearioSaverLoader<I,V,E,M1,M2>().saveToHDFS("String_Node_Str" + getSuperstep() + "String_Node_Str"+ vertex.getId()+ "String_Node_Str",giraphScenarioWrapper);
  }
}

Fixed version (ground truth):
public void compute(Vertex<I,V,E> vertex,Iterable<M1> messages) throws IOException {
  shouldDebugVertex=debugConfig.shouldDebugSuperstep(getSuperstep()) && debugConfig.shouldDebugVertex(vertex.getId());
  if (shouldDebugVertex) {
    initGiraphScenario();
    debugVertexBeforeComputation(vertex,messages);
  }
  computeFurther(vertex,messages);
  if (shouldDebugVertex) {
    giraphScenarioWrapper.getContextWrapper().setVertexValueAfterWrapper(vertex.getValue());
    new GiraphScenearioSaverLoader<I,V,E,M1,M2>().saveToHDFS(FileSystem.get(new Configuration()),"String_Node_Str" + getContext().getJobID() + "String_Node_Str"+ getSuperstep()+ "String_Node_Str"+ vertex.getId()+ "String_Node_Str",giraphScenarioWrapper);
  }
}
Program: 24508
Project: 24508
Buggy source:
private void debugVertexBeforeComputation(Vertex<I,V,E> vertex,Iterable<M1> messages){
  System.out.println("String_Node_Str" + vertex.getId() + "String_Node_Str");
  giraphScenarioWrapper.getContextWrapper().setSuperstepNoWrapper(getSuperstep());
  debugVertex(vertex);
  for (  M1 message : messages) {
    giraphScenarioWrapper.getContextWrapper().addIncomingMessageWrapper(message);
    System.out.print("String_Node_Str" + message);
  }
  System.out.println("String_Node_Str" + vertex.getId() + "String_Node_Str");
}

Fixed version (ground truth):
private void debugVertexBeforeComputation(Vertex<I,V,E> vertex,Iterable<M1> messages) throws IOException {
  giraphScenarioWrapper.getContextWrapper().setSuperstepNoWrapper(getSuperstep());
  giraphScenarioWrapper.getContextWrapper().setVertexIdWrapper(vertex.getId());
  giraphScenarioWrapper.getContextWrapper().setVertexValueBeforeWrapper(vertex.getValue());
  Iterable<Edge<I,E>> returnVal=vertex.getEdges();
  for (  Edge<I,E> edge : returnVal) {
    giraphScenarioWrapper.getContextWrapper().addNeighborWrapper(edge.getTargetVertexId(),edge.getValue());
  }
  for (  M1 message : messages) {
    giraphScenarioWrapper.getContextWrapper().addIncomingMessageWrapper(message);
  }
}
Program: 24509
Project: 24509
Buggy source:
/** 
 * First intercepts the sent messages to all edges if necessary and calls and then calls AbstractComputation's sendMessageToAllEdges method. 
 * @param vertex Vertex whose edges to send the message to.
 * @param message Message sent to all edges.
 */
@Override public void sendMessageToAllEdges(Vertex<I,V,E> vertex,M2 message){
  if (shouldDebugVertex) {
    System.out.print("String_Node_Str" + message);
    for (    Edge<I,E> edge : vertex.getEdges()) {
      System.out.print("String_Node_Str" + edge.getTargetVertexId());
    }
    System.out.println();
  }
  super.sendMessageToAllEdges(vertex,message);
}

Fixed version (ground truth):
/** 
 * First intercepts the sent messages to all edges if necessary and calls and then calls AbstractComputation's sendMessageToAllEdges method. 
 * @param vertex Vertex whose edges to send the message to.
 * @param message Message sent to all edges.
 */
@Override public void sendMessageToAllEdges(Vertex<I,V,E> vertex,M2 message){
  if (shouldDebugVertex) {
  }
  super.sendMessageToAllEdges(vertex,message);
}
Program: 24510
Project: 24510
Buggy source:
/** 
 * First intercepts the sent message if necessary and calls and then calls AbstractComputation's sendMessage method. 
 * @param id Vertex id to send the message to
 * @param message Message data to send
 */
@Override public void sendMessage(I id,M2 message){
  System.out.println("String_Node_Str");
  if (shouldDebugVertex) {
    giraphScenarioWrapper.getContextWrapper().addOutgoingMessageWrapper(id,message);
    System.out.println("String_Node_Str" + id + "String_Node_Str"+ message);
  }
  super.sendMessage(id,message);
}

Fixed version (ground truth):
/** 
 * First intercepts the sent message if necessary and calls and then calls AbstractComputation's sendMessage method. 
 * @param id Vertex id to send the message to
 * @param message Message data to send
 */
@Override public void sendMessage(I id,M2 message){
  if (shouldDebugVertex) {
    giraphScenarioWrapper.getContextWrapper().addOutgoingMessageWrapper(id,message);
  }
  super.sendMessage(id,message);
}
Program: 24511
Project: 24511
Buggy source:
private void initGiraphScenario(){
  System.out.println(this.getClass().getCanonicalName());
  ParameterizedType parameterizedType=(ParameterizedType)debugConfig.getClass().getGenericSuperclass();
  System.out.println(((Class<I>)parameterizedType.getActualTypeArguments()[0]).getCanonicalName());
  System.out.println(((Class<V>)parameterizedType.getActualTypeArguments()[1]).getCanonicalName());
  System.out.println(((Class<E>)parameterizedType.getActualTypeArguments()[2]).getCanonicalName());
  System.out.println(((Class<M1>)parameterizedType.getActualTypeArguments()[3]).getCanonicalName());
  System.out.println(((Class<M2>)parameterizedType.getActualTypeArguments()[4]).getCanonicalName());
  giraphScenarioWrapper=new GiraphScenarioWrapper(this.getClass(),(Class<I>)parameterizedType.getActualTypeArguments()[0],(Class<V>)parameterizedType.getActualTypeArguments()[1],(Class<E>)parameterizedType.getActualTypeArguments()[2],(Class<M1>)parameterizedType.getActualTypeArguments()[3],(Class<M2>)parameterizedType.getActualTypeArguments()[4]);
  giraphScenarioWrapper.setContextWrapper(giraphScenarioWrapper.new ContextWrapper());
}

Fixed version (ground truth):
private void initGiraphScenario(){
  ParameterizedType parameterizedType=(ParameterizedType)debugConfig.getClass().getGenericSuperclass();
  giraphScenarioWrapper=new GiraphScenarioWrapper(this.getClass(),(Class<I>)parameterizedType.getActualTypeArguments()[0],(Class<V>)parameterizedType.getActualTypeArguments()[1],(Class<E>)parameterizedType.getActualTypeArguments()[2],(Class<M1>)parameterizedType.getActualTypeArguments()[3],(Class<M2>)parameterizedType.getActualTypeArguments()[4]);
  giraphScenarioWrapper.setContextWrapper(giraphScenarioWrapper.new ContextWrapper());
}
Program: 24512
Project: 24512
Buggy source:
@Override public boolean shouldDebugVertex(LongWritable vertexId){
  return vertexId.get() == 1L;
}

Fixed version (ground truth):
@Override public boolean shouldDebugVertex(LongWritable vertexId){
  return true;
}
Program: 24513
Project: 24513
Buggy source:
public void setVertexValueAfterWrapper(V vertexValueAfter){
  this.vertexValueAfter=vertexValueAfter;
}

Fixed version (ground truth):
public void setVertexValueAfterWrapper(V vertexValueAfter){
  this.vertexValueAfter=makeCloneOf(vertexValueAfter,vertexValueClass);
}
Program: 24514
Project: 24514
Buggy source:
public void addNeighborWrapper(I neighborId,E edgeValue){
  neighbors.add(new NeighborWrapper(neighborId,edgeValue));
}

Fixed version (ground truth):
public void addNeighborWrapper(I neighborId,E edgeValue){
  neighbors.add(new NeighborWrapper(makeCloneOf(neighborId,vertexIdClass),makeCloneOf(edgeValue,edgeValueClass)));
}
Program: 24515
Project: 24515
Buggy source:
public void addIncomingMessageWrapper(M1 message){
  inMsgs.add(message);
}

Fixed version (ground truth):
public void addIncomingMessageWrapper(M1 message){
  inMsgs.add(makeCloneOf(message,incomingMessageClass));
}
Program: 24516
Project: 24516
Buggy source:
public void addOutgoingMessageWrapper(I receiverId,M2 message){
  outMsgs.add(new OutgoingMessageWrapper(receiverId,message));
}

Fixed version (ground truth):
public void addOutgoingMessageWrapper(I receiverId,M2 message){
  outMsgs.add(new OutgoingMessageWrapper(makeCloneOf(receiverId,vertexIdClass),makeCloneOf(message,outgoingMessageClass)));
}
Program: 24517
Project: 24517
Buggy source:
public void setVertexValueBeforeWrapper(V vertexValueBefore){
  this.vertexValueBefore=vertexValueBefore;
}

Fixed version (ground truth):
public void setVertexValueBeforeWrapper(V vertexValueBefore){
  this.vertexValueBefore=makeCloneOf(vertexValueBefore,vertexValueClass);
}
Program: 24518
Project: 24518
Buggy source:
public void saveToHDFS(String fileName,GiraphScenarioWrapper<I,V,E,M1,M2> scenarioWrapper) throws IOException {
  GiraphScenario giraphScenario=buildGiraphScnearioFromWrapper(scenarioWrapper);
  Path pt=new Path(fileName);
  FileSystem fs=FileSystem.get(new Configuration());
  giraphScenario.writeTo(fs.create(pt,true).getWrappedStream());
}

Fixed version (ground truth):
public void saveToHDFS(FileSystem fs,String fileName,GiraphScenarioWrapper<I,V,E,M1,M2> scenarioWrapper) throws IOException {
  GiraphScenario giraphScenario=buildGiraphScnearioFromWrapper(scenarioWrapper);
  Path pt=new Path(fileName);
  giraphScenario.writeTo(fs.create(pt,true).getWrappedStream());
}
Program: 24520
Project: 24520
Buggy source:
private static <T>T newInstance(Class<T> theClass){
  return NullWritable.class.isAssignableFrom(theClass) ? null : ReflectionUtils.newInstance(theClass);
}

Fixed version (ground truth):
static <T>T newInstance(Class<T> theClass){
  return NullWritable.class.isAssignableFrom(theClass) ? null : ReflectionUtils.newInstance(theClass);
}
Program: 24522
Project: 24522
Buggy source:
@Override public void start(Stage primaryStage){
  TreeView<CheckBoxContentImpl> view=new TreeView<>();
  view.setShowRoot(false);
  view.setCellFactory(TreeCellFactories.checkBoxFactory());
  try {
    LiveDirs<ChangeSource,CheckBoxContentImpl> dirs=new LiveDirs<>(ChangeSource.EXTERNAL,CheckBoxContentImpl::getPath,CheckBoxContentImpl::new,Platform::runLater);
    dirs.addTopLevelDirectory(Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str").toAbsolutePath());
    view.setRoot(dirs.model().getRoot());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  primaryStage.setScene(new Scene(view,500,500));
  primaryStage.show();
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage){
  TreeView<CheckBoxContentImpl> view=new TreeView<>();
  view.setShowRoot(false);
  view.setCellFactory(TreeCellFactories.checkBoxFactory());
  try {
    LiveDirs<ChangeSource,CheckBoxContentImpl> dirs=new LiveDirs<>(ChangeSource.EXTERNAL,CheckBoxContentImpl::getPath,CheckBoxContentImpl::new,Platform::runLater);
    dirs.addTopLevelDirectory(Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str").toAbsolutePath());
    view.setRoot(dirs.model().getRoot());
    primaryStage.setOnCloseRequest(val -> dirs.dispose());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  primaryStage.setScene(new Scene(view,500,500));
  primaryStage.show();
}
Program: 24523
Project: 24523
Buggy source:
@Override public void start(Stage primaryStage){
  TreeView<Path> view=new TreeView<>();
  view.setShowRoot(false);
  try {
    LiveDirs<ChangeSource,Path> dirs=LiveDirs.getNormalInstance(ChangeSource.EXTERNAL);
    dirs.addTopLevelDirectory(Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str").toAbsolutePath());
    view.setRoot(dirs.model().getRoot());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  primaryStage.setScene(new Scene(view,500,500));
  primaryStage.show();
}

Fixed version (ground truth):
@Override public void start(Stage primaryStage){
  TreeView<Path> view=new TreeView<>();
  view.setShowRoot(false);
  try {
    LiveDirs<ChangeSource,Path> dirs=LiveDirs.getNormalInstance(ChangeSource.EXTERNAL);
    dirs.addTopLevelDirectory(Paths.get(System.getProperty("String_Node_Str"),"String_Node_Str").toAbsolutePath());
    view.setRoot(dirs.model().getRoot());
    primaryStage.setOnCloseRequest(val -> dirs.dispose());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  primaryStage.setScene(new Scene(view,500,500));
  primaryStage.show();
}
Program: 24524
Project: 24524
Buggy source:
/** 
 * Creates a LiveDirs instance to be used from a designated thread.
 * @param projector converts the ({@link T})   {@link TreeItem#getValue()} into a {@link Path} object
 * @param injector converts a given {@link Path} object into {@link T}. The reverse of   {@code projector}
 * @param externalInitiator object to represent an initiator of an externalfile-system change.
 * @param clientThreadExecutor executor to execute actions on the callerthread. Used to publish updates and errors on the caller thread.
 * @throws IOException
 */
public LiveDirs(I externalInitiator,Function<T,Path> projector,Function<Path,T> injector,Executor clientThreadExecutor) throws IOException {
  this.externalInitiator=externalInitiator;
  this.clientThreadExecutor=clientThreadExecutor;
  this.dirWatcher=new DirWatcher(clientThreadExecutor);
  this.model=new LiveDirsModel<>(externalInitiator,projector,injector);
  this.io=new LiveDirsIO<>(dirWatcher,model,clientThreadExecutor);
  this.dirWatcher.signalledKeys().subscribe(key -> processKey(key));
  this.errors=EventStreams.merge(dirWatcher.errors(),model.errors(),localErrors);
}

Fixed version (ground truth):
/** 
 * Creates a LiveDirs instance to be used from a designated thread.
 * @param projector converts the ({@link T})   {@link TreeItem#getValue()} into a {@link Path} object
 * @param injector converts a given {@link Path} object into {@link T}. The reverse of   {@code projector}
 * @param externalInitiator object to represent an initiator of an externalfile-system change.
 * @param clientThreadExecutor executor to execute actions on the callerthread. Used to publish updates and errors on the caller thread.
 * @throws IOException
 */
public LiveDirs(I externalInitiator,Function<T,Path> projector,Function<Path,T> injector,Executor clientThreadExecutor) throws IOException {
  this.externalInitiator=externalInitiator;
  this.clientThreadExecutor=clientThreadExecutor;
  this.dirWatcher=new DirWatcher(clientThreadExecutor);
  this.model=new LiveDirsModel<>(externalInitiator,projector,injector);
  this.io=new LiveDirsIO<>(dirWatcher,model,clientThreadExecutor);
  this.dirWatcher.signalledKeys().subscribe(this::processKey);
  this.errors=EventStreams.merge(dirWatcher.errors(),model.errors(),localErrors);
}
Program: 24525
Project: 24525
Buggy source:
private <T>CompletionStage<T> wrap(CompletionStage<T> stage){
  return new CompletionStageWithDefaultExecutor<>(stage,clientThreadExecutor);
}

Fixed version (ground truth):
private <U>CompletionStage<U> wrap(CompletionStage<U> stage){
  return new CompletionStageWithDefaultExecutor<>(stage,clientThreadExecutor);
}
Program: 24526
Project: 24526
Buggy source:
@Override public void run(){
  LOG.info(String.format("String_Node_Str",inboundEndpoint.getName()));
  long delay=0L;
  while (running) {
    try {
      if (delay > 0) {
        try {
          Thread.sleep(delay);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
          LOG.error("String_Node_Str",e);
        }
 finally {
          delay=0;
        }
      }
      TestContext context=testContextFactory.getObject();
      Message message=inboundEndpoint.createConsumer().receive(context,inboundEndpoint.getEndpointConfiguration().getTimeout());
      if (message != null) {
        LOG.debug(String.format("String_Node_Str",message.getId()));
        Message response=endpointAdapter.handleMessage(processRequestMessage(message));
        if (response != null) {
          Producer producer=inboundEndpoint.createProducer();
          if (producer instanceof ReplyProducer) {
            LOG.debug(String.format("String_Node_Str",message.getId()));
            producer.send(processResponseMessage(response),context);
          }
        }
      }
    }
 catch (    ActionTimeoutException e) {
    }
catch (    SimulatorException|CitrusRuntimeException e) {
      LOG.error("String_Node_Str",e.getMessage());
      if (LOG.isDebugEnabled()) {
        LOG.debug(e.getMessage(),e);
      }
    }
catch (    Exception e) {
      delay=exceptionDelay;
      LOG.error("String_Node_Str",e.getMessage());
      if (LOG.isDebugEnabled()) {
        LOG.debug(e.getMessage(),e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  LOG.info("String_Node_Str",inboundEndpoint.getName());
  long delay=0L;
  while (running) {
    try {
      if (delay > 0) {
        try {
          Thread.sleep(delay);
        }
 catch (        InterruptedException e) {
          Thread.currentThread().interrupt();
          LOG.error("String_Node_Str",e);
        }
 finally {
          delay=0;
        }
      }
      TestContext context=testContextFactory.getObject();
      Message message=inboundEndpoint.createConsumer().receive(context,inboundEndpoint.getEndpointConfiguration().getTimeout());
      if (message != null) {
        LOG.debug("String_Node_Str",message.getId());
        Message response=endpointAdapter.handleMessage(processRequestMessage(message));
        if (response != null) {
          Producer producer=inboundEndpoint.createProducer();
          if (producer instanceof ReplyProducer) {
            LOG.debug("String_Node_Str",message.getId());
            producer.send(processResponseMessage(response),context);
          }
        }
      }
    }
 catch (    ActionTimeoutException e) {
    }
catch (    SimulatorException|CitrusRuntimeException e) {
      LOG.error("String_Node_Str",e.getMessage());
      if (LOG.isDebugEnabled()) {
        LOG.debug(e.getMessage(),e);
      }
    }
catch (    Exception e) {
      delay=exceptionDelay;
      LOG.error("String_Node_Str",e.getMessage());
      if (LOG.isDebugEnabled()) {
        LOG.debug(e.getMessage(),e);
      }
    }
  }
}
Program: 24527
Project: 24527
Buggy source:
@Override public String extractMappingKey(Message request){
  Optional<String> v=keyExtractors.parallelStream().map(keyExtractor -> lookupScenarioName(request,keyExtractor)).filter(Optional::isPresent).map(Optional::get).findAny();
  return v.orElse(null);
}

Fixed version (ground truth):
@Override public String extractMappingKey(Message request){
  Optional<String> v=keyExtractors.stream().map(keyExtractor -> lookupScenarioName(request,keyExtractor)).filter(Optional::isPresent).map(Optional::get).findFirst();
  return v.orElse(null);
}