nus-yam/ex-repair huggingface dataset:
Program: 59687
Project: 59687
Buggy source:
/** 
 * Set the driver memory
 */
public void setDriverInfo(final String identifier,final int memory,final String jobSubmissionDirectory){
  if (identifier == null || identifier.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (memory <= 0) {
    throw new RuntimeException("String_Node_Str" + memory);
  }
  this.driverMemory=memory;
  this.driverId=identifier;
  if (jobSubmissionDirectory != null && !jobSubmissionDirectory.equals("String_Node_Str")) {
    this.jobSubmissionDirectory=jobSubmissionDirectory;
  }
 else {
    LOG.log(Level.FINE,"String_Node_Str" + this.jobSubmissionDirectory);
  }
}

Fixed version (ground truth):
/** 
 * Set the driver memory.
 */
public void setDriverInfo(final String identifier,final int memory,final String jobSubmissionDirectory){
  if (identifier == null || identifier.isEmpty()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (memory <= 0) {
    throw new RuntimeException("String_Node_Str" + memory);
  }
  this.driverMemory=memory;
  this.driverId=identifier;
  if (jobSubmissionDirectory != null && !jobSubmissionDirectory.equals("String_Node_Str")) {
    this.jobSubmissionDirectory=jobSubmissionDirectory;
  }
 else {
    LOG.log(Level.FINE,"String_Node_Str" + this.jobSubmissionDirectory);
  }
}
Program: 59688
Project: 59688
Buggy source:
/** 
 * process http request
 */
@Override public void onHttpRequest(final ParsedHttpRequest parsedHttpRequest,final HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",parsedHttpRequest.getRequestUri());
  try (final LoggingScope ls=loggingScopeFactory.httpRequest(parsedHttpRequest.getRequestUri())){
    final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
    final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(parsedHttpRequest);
    final String requestString=httpSerializer.toString(avroHttpRequest);
    final byte[] requestBytes=requestString.getBytes();
    try {
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
      NativeInterop.ClrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
      final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
      response.getWriter().println(responseBody);
      LOG.log(Level.INFO,"String_Node_Str",responseBody);
    }
 catch (    final Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      throw new RuntimeException(ex);
    }
  }
 }

Fixed version (ground truth):
/** 
 * process http request.
 */
@Override public void onHttpRequest(final ParsedHttpRequest parsedHttpRequest,final HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",parsedHttpRequest.getRequestUri());
  try (final LoggingScope ls=loggingScopeFactory.httpRequest(parsedHttpRequest.getRequestUri())){
    final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
    final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(parsedHttpRequest);
    final String requestString=httpSerializer.toString(avroHttpRequest);
    final byte[] requestBytes=requestString.getBytes();
    try {
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
      NativeInterop.ClrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
      final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
      response.getWriter().println(responseBody);
      LOG.log(Level.INFO,"String_Node_Str",responseBody);
    }
 catch (    final Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      throw new RuntimeException(ex);
    }
  }
 }
Program: 59689
Project: 59689
Buggy source:
/** 
 * returns URI specification for the handler
 */
@Override public String getUriSpecification(){
  return uriSpecification;
}

Fixed version (ground truth):
/** 
 * returns URI specification for the handler.
 */
@Override public String getUriSpecification(){
  return uriSpecification;
}
Program: 59691
Project: 59691
Buggy source:
/** 
 * Main method that starts the CLR Bridge from Java
 * @param args command line parameters.
 */
public static void main(final String[] args){
  try {
    if (args == null || args.length == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    final File dotNetFolder=new File(args[0]).getAbsoluteFile();
    ConfigurationModule driverConfigModule=JobClient.getDriverConfiguration();
    ConfigurationModule result=driverConfigModule;
    for (    final File f : dotNetFolder.listFiles()) {
      if (f.canRead() && f.exists() && f.isFile()) {
        result=result.set(DriverConfiguration.GLOBAL_FILES,f.getAbsolutePath());
      }
    }
    driverConfigModule=result;
    Configuration driverConfiguration=Configurations.merge(driverConfigModule.build(),JobClient.getHTTPConfiguration());
    LOG.log(Level.INFO,"String_Node_Str");
    final Configuration runtimeConfiguration=YarnClientConfiguration.CONF.build();
    final REEF reef=Tang.Factory.getTang().newInjector(runtimeConfiguration).getInstance(REEFImplementation.class);
    reef.submit(driverConfiguration);
    LOG.info("String_Node_Str");
  }
 catch (  final BindException|InjectionException ex) {
    LOG.log(Level.SEVERE,"String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Main method that starts the CLR Bridge from Java.
 * @param args command line parameters.
 */
public static void main(final String[] args){
  try {
    if (args == null || args.length == 0) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    final File dotNetFolder=new File(args[0]).getAbsoluteFile();
    ConfigurationModule driverConfigModule=JobClient.getDriverConfiguration();
    ConfigurationModule result=driverConfigModule;
    for (    final File f : dotNetFolder.listFiles()) {
      if (f.canRead() && f.exists() && f.isFile()) {
        result=result.set(DriverConfiguration.GLOBAL_FILES,f.getAbsolutePath());
      }
    }
    driverConfigModule=result;
    Configuration driverConfiguration=Configurations.merge(driverConfigModule.build(),JobClient.getHTTPConfiguration());
    LOG.log(Level.INFO,"String_Node_Str");
    final Configuration runtimeConfiguration=YarnClientConfiguration.CONF.build();
    final REEF reef=Tang.Factory.getTang().newInjector(runtimeConfiguration).getInstance(REEFImplementation.class);
    reef.submit(driverConfiguration);
    LOG.info("String_Node_Str");
  }
 catch (  final BindException|InjectionException ex) {
    LOG.log(Level.SEVERE,"String_Node_Str",ex);
  }
}
Program: 59692
Project: 59692
Buggy source:
/** 
 * Generate a new checkpoint Name
 * @return the checkpoint name
 */
public String getNewName();

Fixed version (ground truth):
/** 
 * Generate a new checkpoint Name.
 * @return the checkpoint name
 */
public String getNewName();
Program: 59693
Project: 59693
Buggy source:
/** 
 * The global list of racks
 * @return list of all rack descriptors
 */
public Collection<RackDescriptor> getRacks();

Fixed version (ground truth):
/** 
 * The global list of racks.
 * @return list of all rack descriptors
 */
public Collection<RackDescriptor> getRacks();
Program: 59694
Project: 59694
Buggy source:
/** 
 * Instantiated via CLRProcessFactory
 */
CLRProcess(){
}

Fixed version (ground truth):
/** 
 * Instantiated via CLRProcessFactory.
 */
CLRProcess(){
}
Program: 59695
Project: 59695
Buggy source:
/** 
 * Set the launch identifier
 * @param launchID
 * @return this
 */
EvaluatorProcess setLaunchID(final String launchID);

Fixed version (ground truth):
/** 
 * Set the launch identifier.
 * @param launchID
 * @return this
 */
EvaluatorProcess setLaunchID(final String launchID);
Program: 59696
Project: 59696
Buggy source:
/** 
 * Set the error handler remote identifier
 * @param errorHandlerRID
 * @return this
 */
EvaluatorProcess setErrorHandlerRID(final String errorHandlerRID);

Fixed version (ground truth):
/** 
 * Set the error handler remote identifier.
 * @param errorHandlerRID
 * @return this
 */
EvaluatorProcess setErrorHandlerRID(final String errorHandlerRID);
Program: 59697
Project: 59697
Buggy source:
/** 
 * Set memory size of process in megabytes
 * @param megaBytes
 * @return this
 */
EvaluatorProcess setMemory(final int megaBytes);

Fixed version (ground truth):
/** 
 * Set memory size of process in megabytes.
 * @param megaBytes
 * @return this
 */
EvaluatorProcess setMemory(final int megaBytes);
Program: 59698
Project: 59698
Buggy source:
/** 
 * set number of cores
 * @param cores the number of cores
 * @return
 */
public Builder setNumberOfCores(final int cores){
  this.cores=cores;
  return this;
}

Fixed version (ground truth):
/** 
 * set number of cores.
 * @param cores the number of cores
 * @return
 */
public Builder setNumberOfCores(final int cores){
  this.cores=cores;
  return this;
}
Program: 59699
Project: 59699
Buggy source:
private void loadCLRBridgeDLL() throws IOException {
}

Fixed version (ground truth):
private void loadCLRBridgeDLL() throws IOException {
  try {
    File bridgeClrDLLFile=this.reefFileNames.getBridgeClrDLLFile();
    LOG.log(Level.INFO,"String_Node_Str",bridgeClrDLLFile);
    loadManagedDLL(bridgeClrDLLFile);
  }
 catch (  final Throwable t) {
    LOG.log(Level.WARNING,"String_Node_Str",this.reefFileNames.getBridgeClrDLLFile().getAbsolutePath());
    final String tempLoadDir=System.getProperty(USER_DIR) + this.reefFileNames.getLoadDir();
    new File(tempLoadDir).mkdir();
    LOG.log(Level.INFO,"String_Node_Str",tempLoadDir);
    String bridgeClrDllName=this.reefFileNames.getBridgeClrDllName();
    LOG.log(Level.INFO,"String_Node_Str",bridgeClrDllName);
    loadFromReefJar(bridgeClrDllName,true);
  }
}
Program: 59700
Project: 59700
Buggy source:
/** 
 * Send the evaluatorControlProto to the Evaluator.
 * @param evaluatorControlProto
 * @throws java.lang.IllegalStateException if the remote ID hasn't been set via setRemoteID() prior to this call
 * @throws java.lang.IllegalStateException if the Evaluator isn't running.
 */
public synchronized void send(final EvaluatorRuntimeProtocol.EvaluatorControlProto evaluatorControlProto){
  if (!this.wrapped.isPresent()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!this.stateManager.isRunning()) {
    final String msg=new StringBuilder().append("String_Node_Str").append(this.evaluatorId).append("String_Node_Str").append(this.stateManager.toString()).append("String_Node_Str").append(evaluatorControlProto.toString()).toString();
    throw new IllegalStateException(msg);
  }
  this.wrapped.get().onNext(evaluatorControlProto);
}

Fixed version (ground truth):
/** 
 * Send the evaluatorControlProto to the Evaluator.
 * @param evaluatorControlProto
 * @throws java.lang.IllegalStateException if the remote ID hasn't been set via setRemoteID() prior to this call
 * @throws java.lang.IllegalStateException if the Evaluator isn't running.
 */
public synchronized void send(final EvaluatorRuntimeProtocol.EvaluatorControlProto evaluatorControlProto){
  if (!this.wrapped.isPresent()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!this.stateManager.isRunning()) {
    LOG.log(Level.WARNING,"String_Node_Str",new Object[]{this.evaluatorId,this.stateManager,evaluatorControlProto});
    return;
  }
  this.wrapped.get().onNext(evaluatorControlProto);
}
Program: 59703
Project: 59703
Buggy source:
/** 
 * process http request
 */
@Override public void onHttpRequest(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",request.getRequestURI());
  final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
  final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(request);
  final byte[] requestBytes=httpSerializer.toBytes(avroHttpRequest);
  try {
    final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
    NativeInterop.ClrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
    final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
    response.getWriter().println(responseBody);
    LOG.log(Level.INFO,"String_Node_Str",responseBody);
  }
 catch (  final Exception ex) {
    LOG.log(Level.SEVERE,"String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
}

Fixed version (ground truth):
/** 
 * process http request
 */
@Override public void onHttpRequest(final ParsedHttpRequest parsedHttpRequest,final HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",parsedHttpRequest.getRequestUri());
  final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
  final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(parsedHttpRequest);
  final byte[] requestBytes=httpSerializer.toBytes(avroHttpRequest);
  try {
    final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
    NativeInterop.ClrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
    final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
    response.getWriter().println(responseBody);
    LOG.log(Level.INFO,"String_Node_Str",responseBody);
  }
 catch (  final Exception ex) {
    LOG.log(Level.SEVERE,"String_Node_Str",ex);
    throw new RuntimeException(ex);
  }
}
Program: 59705
Project: 59705
Buggy source:
@Override public void onNext(final RemoteMessage<EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto> evaluatorHeartbeatMessage){
  final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto heartbeat=evaluatorHeartbeatMessage.getMessage();
  final ReefServiceProtos.EvaluatorStatusProto status=heartbeat.getEvaluatorStatus();
  final String evaluatorId=status.getEvaluatorId();
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorId);
  LOG.log(Level.FINEST,"String_Node_Str",new Object[]{evaluatorId,status.getState(),heartbeat.getTimestamp(),evaluatorHeartbeatMessage.getIdentifier()});
  if (heartbeat.hasRecovery() && heartbeat.getRecovery()) {
    EvaluatorManager recoveredEvaluator=this.evaluatorManagerFactory.recoverEvaluatorManager(heartbeat);
    evaluators.put(recoveredEvaluator);
  }
  final Optional<EvaluatorManager> evaluatorManager=this.evaluators.get(evaluatorId);
  if (evaluatorManager.isPresent()) {
    evaluatorManager.get().onEvaluatorHeartbeatMessage(evaluatorHeartbeatMessage);
  }
 else {
    final StringBuilder message=new StringBuilder("String_Node_Str");
    message.append(evaluatorId);
    if (heartbeat.hasEvaluatorStatus()) {
      message.append("String_Node_Str");
      message.append(status.getState());
    }
    message.append('\'');
    throw new RuntimeException(message.toString());
  }
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorId);
}

Fixed version (ground truth):
@Override public void onNext(final RemoteMessage<EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto> evaluatorHeartbeatMessage){
  final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto heartbeat=evaluatorHeartbeatMessage.getMessage();
  final ReefServiceProtos.EvaluatorStatusProto status=heartbeat.getEvaluatorStatus();
  final String evaluatorId=status.getEvaluatorId();
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorId);
  LOG.log(Level.FINEST,"String_Node_Str",new Object[]{evaluatorId,status.getState(),heartbeat.getTimestamp(),evaluatorHeartbeatMessage.getIdentifier()});
  if (heartbeat.hasRecovery() && heartbeat.getRecovery()) {
    final EvaluatorManager recoveredEvaluator=this.evaluatorManagerFactory.recoverEvaluatorManager(heartbeat);
    this.evaluators.put(recoveredEvaluator);
  }
  final Optional<EvaluatorManager> evaluatorManager=this.evaluators.get(evaluatorId);
  if (evaluatorManager.isPresent()) {
    evaluatorManager.get().onEvaluatorHeartbeatMessage(evaluatorHeartbeatMessage);
  }
 else {
    final StringBuilder message=new StringBuilder("String_Node_Str");
    message.append(evaluatorId);
    if (heartbeat.hasEvaluatorStatus()) {
      message.append("String_Node_Str");
      message.append(status.getState());
    }
    message.append('\'');
    throw new RuntimeException(message.toString());
  }
  LOG.log(Level.FINEST,"String_Node_Str",evaluatorId);
}
Program: 59707
Project: 59707
Buggy source:
@Override public List<String> build(){
  final List<String> result=new LinkedList<>();
  result.add(EVALUATOR_PATH);
  result.add(errorHandlerRID);
  result.add(evaluatorConfigurationPath);
  if ((null != this.standardOutPath) && (!standardOutPath.isEmpty())) {
    result.add("String_Node_Str" + this.standardOutPath);
  }
  if ((null != this.standardErrPath) && (!standardErrPath.isEmpty())) {
    result.add("String_Node_Str" + this.standardErrPath);
  }
  LOG.log(Level.FINE,"String_Node_Str",StringUtils.join(result,' '));
  return result;
}

Fixed version (ground truth):
@Override public List<String> build(){
  final List<String> result=new LinkedList<>();
  File f=new File(EVALUATOR_PATH);
  if (!f.exists()) {
    LOG.log(Level.WARNING,"String_Node_Str",f.getAbsolutePath());
  }
  result.add(f.getPath());
  result.add(errorHandlerRID);
  result.add(evaluatorConfigurationPath);
  if ((null != this.standardOutPath) && (!standardOutPath.isEmpty())) {
    result.add("String_Node_Str" + this.standardOutPath);
  }
  if ((null != this.standardErrPath) && (!standardErrPath.isEmpty())) {
    result.add("String_Node_Str" + this.standardErrPath);
  }
  LOG.log(Level.FINE,"String_Node_Str",StringUtils.join(result,' '));
  return result;
}
Program: 59708
Project: 59708
Buggy source:
void setLink(Link<byte[]> link){
  LOG.log(Level.FINEST,"String_Node_Str",new Object[]{Thread.currentThread(),link});
  if (linkRef.compareAndSet(null,link)) {
    consumeQueue();
  }
}

Fixed version (ground truth):
void setLink(Link<byte[]> link){
  LOG.log(Level.FINEST,"String_Node_Str",new Object[]{Thread.currentThread(),link});
  if (linkRef.compareAndSet(null,link)) {
    consumeQueue();
  }
 else {
    consumeQueue();
  }
}
Program: 59709
Project: 59709
Buggy source:
/** 
 * @return the class path for the process.
 */
public String getClasspath(){
  return Joiner.on(File.pathSeparator).join(getClassPathList());
}

Fixed version (ground truth):
/** 
 * @return the class path for the process.
 */
public String getClasspath(){
  return StringUtils.join(getClassPathList(),File.pathSeparatorChar);
}
Program: 59710
Project: 59710
Buggy source:
public List<String> getClassPathList(){
  return Arrays.asList(getLocalFolderPath() + "String_Node_Str",getGlobalFolderPath() + "String_Node_Str");
}

Fixed version (ground truth):
public List<String> getClassPathList(){
  return OSUtils.isWindows() ? Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",getLocalFolderPath() + "String_Node_Str",getGlobalFolderPath() + "String_Node_Str") : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",getLocalFolderPath() + "String_Node_Str",getGlobalFolderPath() + "String_Node_Str");
}
Program: 59711
Project: 59711
Buggy source:
/** 
 * Processes a resource launch request.
 * @param launchRequest the launch request to be processed.
 */
final void onResourceLaunchRequest(final DriverRuntimeProtocol.ResourceLaunchProto launchRequest){
synchronized (this.theContainers) {
    final Container c=this.theContainers.get(launchRequest.getIdentifier());
    c.addGlobalFiles(this.fileNames.getGlobalFolder());
    c.addLocalFiles(getLocalFiles(launchRequest));
    final List<String> classPath=this.fileNames.getClassPathList();
    final File evaluatorConfigurationFile=new File(c.getFolder(),fileNames.getEvaluatorConfigurationPath());
    try {
      this.configurationSerializer.toFile(this.configurationSerializer.fromString(launchRequest.getEvaluatorConf()),evaluatorConfigurationFile);
    }
 catch (    final IOException|BindException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    final LaunchCommandBuilder commandBuilder;
switch (launchRequest.getType()) {
case JVM:
      commandBuilder=new JavaLaunchCommandBuilder().setClassPath(classPath);
    break;
case CLR:
  commandBuilder=new CLRLaunchCommandBuilder();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + launchRequest.getType());
}
final List<String> command=commandBuilder.setErrorHandlerRID(this.remoteManager.getMyIdentifier()).setLaunchID(c.getNodeID()).setConfigurationFileName(this.fileNames.getEvaluatorConfigurationPath()).setMemory(c.getMemory()).build();
LOG.log(Level.FINEST,"String_Node_Str",c);
c.run(command);
}
}

Fixed version (ground truth):
/** 
 * Processes a resource launch request.
 * @param launchRequest the launch request to be processed.
 */
final void onResourceLaunchRequest(final DriverRuntimeProtocol.ResourceLaunchProto launchRequest){
synchronized (this.theContainers) {
    final Container c=this.theContainers.get(launchRequest.getIdentifier());
    c.addGlobalFiles(this.fileNames.getGlobalFolder());
    c.addLocalFiles(getLocalFiles(launchRequest));
    final File evaluatorConfigurationFile=new File(c.getFolder(),fileNames.getEvaluatorConfigurationPath());
    try {
      this.configurationSerializer.toFile(this.configurationSerializer.fromString(launchRequest.getEvaluatorConf()),evaluatorConfigurationFile);
    }
 catch (    final IOException|BindException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
    final LaunchCommandBuilder commandBuilder;
switch (launchRequest.getType()) {
case JVM:
      commandBuilder=new JavaLaunchCommandBuilder().setClassPath(this.fileNames.getClassPathList());
    break;
case CLR:
  commandBuilder=new CLRLaunchCommandBuilder();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + launchRequest.getType());
}
final List<String> command=commandBuilder.setErrorHandlerRID(this.remoteManager.getMyIdentifier()).setLaunchID(c.getNodeID()).setConfigurationFileName(this.fileNames.getEvaluatorConfigurationPath()).setMemory(c.getMemory()).build();
LOG.log(Level.FINEST,"String_Node_Str",c);
c.run(command);
}
}
Program: 59713
Project: 59713
Buggy source:
private String getClassPath(){
  return StringUtils.join(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.filenames.getClasspath()),';');
}

Fixed version (ground truth):
private String getClassPath(){
  return StringUtils.join(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.filenames.getClasspath()),File.pathSeparatorChar);
}
Program: 59714
Project: 59714
Buggy source:
private String getClasspath(){
  return StringUtils.join(Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.fileNames.getClasspath()),':');
}

Fixed version (ground truth):
private String getClasspath(){
  return StringUtils.join(OSUtils.isWindows() ? Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.fileNames.getClasspath()) : Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",this.fileNames.getClasspath()),File.pathSeparatorChar);
}
Program: 59715
Project: 59715
Buggy source:
@Test public void testHttpServer() throws BindException, InjectionException {
  final Configuration runtimeConfiguration=LocalRuntimeConfiguration.CONF.set(LocalRuntimeConfiguration.NUMBER_OF_THREADS,2).build();
  final LauncherStatus status=HelloREEFHttp.runHelloReef(runtimeConfiguration,10 * 1000);
  Assert.assertTrue("String_Node_Str" + status,status.isSuccess());
}

Fixed version (ground truth):
@Test public void testHttpServer() throws BindException, InjectionException {
  final Configuration runtimeConfiguration=LocalRuntimeConfiguration.CONF.set(LocalRuntimeConfiguration.NUMBER_OF_THREADS,2).build();
  final LauncherStatus status=HelloREEFHttp.runHelloReef(runtimeConfiguration,10 * 1000);
  Assert.assertEquals(LauncherStatus.FORCE_CLOSED,status);
}
Program: 59716
Project: 59716
Buggy source:
@Inject PoisonedContextStartHandler(final @Parameter(CrashProbability.class) double crashProbability,final @Parameter(CrashTimeout.class) int timeOut,final Clock clock){
  this.crashProbability=crashProbability;
  this.timeOut=timeOut;
  this.clock=clock;
}

Fixed version (ground truth):
@Inject public PoisonedContextStartHandler(final @Parameter(CrashProbability.class) double crashProbability,final @Parameter(CrashTimeout.class) int timeOut,final Clock clock){
  this.crashProbability=crashProbability;
  this.timeOut=timeOut;
  this.clock=clock;
}
Program: 59717
Project: 59717
Buggy source:
@Override public void onNext(final ContextStart contextStart){
  LOG.log(Level.INFO,"String_Node_Str",this.crashProbability);
  final Random random=new Random();
  if (random.nextDouble() <= this.crashProbability) {
    final int timeToCrash=random.nextInt(this.timeOut) * 1000;
    LOG.log(Level.INFO,"String_Node_Str",timeToCrash);
    this.clock.scheduleAlarm(timeToCrash,new PoisonedAlarmHandler());
  }
}

Fixed version (ground truth):
@Override public void onNext(final ContextStart contextStart){
  LOG.log(Level.INFO,"String_Node_Str",this.crashProbability);
  if (this.random.nextDouble() <= this.crashProbability) {
    final int timeToCrash=this.random.nextInt(this.timeOut) * 1000;
    LOG.log(Level.INFO,"String_Node_Str",timeToCrash);
    if (timeToCrash == 0) {
      throw new PoisonException("String_Node_Str" + System.currentTimeMillis());
    }
 else {
      this.clock.scheduleAlarm(timeToCrash,new PoisonedAlarmHandler());
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
}
Program: 59718
Project: 59718
Buggy source:
@Inject PoisonedTaskStartHandler(final @Parameter(CrashProbability.class) double crashProbability,final @Parameter(CrashTimeout.class) int timeOut,final Clock clock){
  this.crashProbability=crashProbability;
  this.timeOut=timeOut;
  this.clock=clock;
}

Fixed version (ground truth):
@Inject public PoisonedTaskStartHandler(final @Parameter(CrashProbability.class) double crashProbability,final @Parameter(CrashTimeout.class) int timeOut,final Clock clock){
  this.crashProbability=crashProbability;
  this.timeOut=timeOut;
  this.clock=clock;
}
Program: 59719
Project: 59719
Buggy source:
@Override public void onNext(final TaskStart taskStart){
  LOG.log(Level.INFO,"String_Node_Str",this.crashProbability);
  final Random random=new Random();
  if (random.nextDouble() <= this.crashProbability) {
    LOG.info("String_Node_Str");
    final int timeToCrash=random.nextInt(this.timeOut) * 1000;
    if (timeToCrash == 0) {
      LOG.info("String_Node_Str");
      throw new PoisonException("String_Node_Str" + System.currentTimeMillis());
    }
 else {
      LOG.log(Level.INFO,"String_Node_Str",timeToCrash);
      this.clock.scheduleAlarm(timeToCrash,new PoisonedAlarmHandler());
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onNext(final TaskStart taskStart){
  LOG.log(Level.INFO,"String_Node_Str",this.crashProbability);
  if (this.random.nextDouble() <= this.crashProbability) {
    final int timeToCrash=this.random.nextInt(this.timeOut) * 1000;
    LOG.log(Level.INFO,"String_Node_Str",timeToCrash);
    if (timeToCrash == 0) {
      throw new PoisonException("String_Node_Str" + System.currentTimeMillis());
    }
 else {
      this.clock.scheduleAlarm(timeToCrash,new PoisonedAlarmHandler());
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
}
Program: 59720
Project: 59720
Buggy source:
@Override public void onNext(final EvaluatorRequest request){
  LOG.log(Level.FINE,"String_Node_Str",request.getNumber());
  for (; ; ) {
    try {
      this.resourceRequestGate.await();
      break;
    }
 catch (    final InterruptedException ex) {
      LOG.log(Level.FINEST,"String_Node_Str",ex);
    }
  }
  LOG.log(Level.FINE,"String_Node_Str",request);
  this.resourceRequestGate=new CountDownLatch(1);
  this.requestor.submit(request);
}

Fixed version (ground truth):
@Override public void onNext(final EvaluatorRequest request){
  try {
    LOG.log(Level.FINE,"String_Node_Str",request.getNumber());
    this.resourceRequestGate.await();
    LOG.log(Level.FINE,"String_Node_Str",request);
    this.resourceRequestGate=new CountDownLatch(1);
    this.requestor.submit(request);
  }
 catch (  final InterruptedException ex) {
    LOG.log(Level.FINEST,"String_Node_Str",ex);
  }
}
Program: 59721
Project: 59721
Buggy source:
/** 
 * Closes all EvaluatorManager instances managed.
 */
@Override public synchronized void close(){
  for (  final EvaluatorManager evaluatorManager : new ArrayList<>(this.evaluators.values())) {
    LOG.log(Level.WARNING,"String_Node_Str",evaluatorManager.getId());
    evaluatorManager.close();
  }
}

Fixed version (ground truth):
/** 
 * Closes all EvaluatorManager instances managed.
 */
@Override public void close(){
  final List<EvaluatorManager> evaluatorsCopy;
synchronized (this) {
    evaluatorsCopy=new ArrayList<>(this.evaluators.values());
  }
  for (  final EvaluatorManager evaluatorManager : evaluatorsCopy) {
    LOG.log(Level.WARNING,"String_Node_Str",evaluatorManager.getId());
    evaluatorManager.close();
  }
}
Program: 59722
Project: 59722
Buggy source:
/** 
 * Flushes the remaining buffered logs and shuts down the log scheduler thread.
 */
@Override public void close() throws SecurityException {
  logAll();
  this.logScheduler.shutdown();
}

Fixed version (ground truth):
/** 
 * Flushes the remaining buffered logs and shuts down the log scheduler thread.
 */
@Override public synchronized void close() throws SecurityException {
  if (driverInitialized) {
    this.logAll();
  }
  this.logScheduler.shutdown();
}
Program: 59723
Project: 59723
Buggy source:
/** 
 * Get an input split to be assigned to this evaluator Allocates one if its not already allocated
 * @param evaluatorId
 * @return
 */
public NumberedSplit<V> getInputSplit(final String evaluatorId){
synchronized (evaluatorToSplits) {
    if (evaluatorToSplits.containsKey(evaluatorId)) {
      LOG.log(Level.FINE,"String_Node_Str");
      LOG.log(Level.FINE,evaluatorToSplits.toString());
      return evaluatorToSplits.get(evaluatorId);
    }
  }
  LOG.log(Level.FINE,"String_Node_Str");
  if (locationToSplits.containsKey(evaluatorId)) {
    LOG.log(Level.FINE,"String_Node_Str" + evaluatorId);
    final NumberedSplit<V> split=allocateSplit(evaluatorId,locationToSplits.get(evaluatorId));
    LOG.log(Level.FINE,evaluatorToSplits.toString());
    if (split != null) {
      return split;
    }
  }
  LOG.log(Level.FINE,evaluatorId + "String_Node_Str");
  final NumberedSplit<V> split=allocateSplit(evaluatorId,unallocatedSplits);
  LOG.log(Level.FINE,evaluatorToSplits.toString());
  if (split != null) {
    return split;
  }
  throw new RuntimeException("String_Node_Str" + evaluatorId);
}

Fixed version (ground truth):
/** 
 * Get an input split to be assigned to this evaluator Allocates one if its not already allocated
 * @param evaluatorId
 * @return
 */
public NumberedSplit<V> getInputSplit(final String hostName,final String evaluatorId){
synchronized (evaluatorToSplits) {
    if (evaluatorToSplits.containsKey(evaluatorId)) {
      LOG.log(Level.FINE,"String_Node_Str");
      LOG.log(Level.FINE,evaluatorToSplits.toString());
      return evaluatorToSplits.get(evaluatorId);
    }
  }
  LOG.log(Level.FINE,"String_Node_Str");
  if (locationToSplits.containsKey(hostName)) {
    LOG.log(Level.FINE,"String_Node_Str" + evaluatorId + "String_Node_Str"+ hostName);
    final NumberedSplit<V> split=allocateSplit(evaluatorId,locationToSplits.get(hostName));
    LOG.log(Level.FINE,evaluatorToSplits.toString());
    if (split != null) {
      return split;
    }
  }
  LOG.log(Level.FINE,hostName + "String_Node_Str");
  final NumberedSplit<V> split=allocateSplit(evaluatorId,unallocatedSplits);
  LOG.log(Level.FINE,evaluatorToSplits.toString());
  if (split != null) {
    return split;
  }
  throw new RuntimeException("String_Node_Str" + evaluatorId);
}
Program: 59724
Project: 59724
Buggy source:
private NumberedSplit<V> allocateSplit(final String evaluatorId,final BlockingQueue<NumberedSplit<V>> value){
  if (value == null) {
    LOG.log(Level.FINE,"String_Node_Str");
    return null;
  }
  final NumberedSplit<V> split=value.poll();
  if (split != null && (value == unallocatedSplits || unallocatedSplits.remove(split))) {
    LOG.log(Level.FINE,"String_Node_Str" + split.getIndex() + "String_Node_Str");
    final NumberedSplit<V> old=evaluatorToSplits.putIfAbsent(evaluatorId,split);
    if (old != null) {
      final String msg="String_Node_Str" + "String_Node_Str";
      LOG.severe(msg);
      throw new RuntimeException(msg);
    }
 else {
      LOG.log(Level.FINE,"String_Node_Str" + split.getIndex());
      return split;
    }
  }
  return null;
}

Fixed version (ground truth):
private NumberedSplit<V> allocateSplit(final String evaluatorId,final BlockingQueue<NumberedSplit<V>> value){
  if (value == null) {
    LOG.log(Level.FINE,"String_Node_Str");
    return null;
  }
  while (true) {
    final NumberedSplit<V> split=value.poll();
    if (split == null)     return null;
    if (value == unallocatedSplits || unallocatedSplits.remove(split)) {
      LOG.log(Level.FINE,"String_Node_Str" + split.getIndex() + "String_Node_Str");
      final NumberedSplit<V> old=evaluatorToSplits.putIfAbsent(evaluatorId,split);
      if (old != null) {
        final String msg="String_Node_Str" + "String_Node_Str";
        LOG.severe(msg);
        throw new RuntimeException(msg);
      }
 else {
        LOG.log(Level.FINE,"String_Node_Str" + split.getIndex());
        return split;
      }
    }
  }
}
Program: 59725
Project: 59725
Buggy source:
/** 
 * Initializes the locations of splits mapping
 * @param splits
 */
public EvaluatorToPartitionMapper(V[] splits){
  try {
    for (int splitNum=0; splitNum < splits.length; splitNum++) {
      LOG.log(Level.FINE,"String_Node_Str" + splitNum);
      final V split=splits[splitNum];
      final String[] locations=split.getLocations();
      final NumberedSplit<V> numberedSplit=new NumberedSplit<V>(split,splitNum);
      unallocatedSplits.add(numberedSplit);
      for (      final String location : locations) {
        BlockingQueue<NumberedSplit<V>> newSplitQue=new LinkedBlockingQueue<NumberedSplit<V>>();
        final BlockingQueue<NumberedSplit<V>> splitQue=locationToSplits.putIfAbsent(location,newSplitQue);
        if (splitQue != null) {
          newSplitQue=splitQue;
        }
        newSplitQue.add(numberedSplit);
      }
    }
    LOG.log(Level.FINE,locationToSplits.toString());
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the locations of splits mapping
 * @param splits
 */
public EvaluatorToPartitionMapper(V[] splits){
  try {
    for (int splitNum=0; splitNum < splits.length; splitNum++) {
      LOG.log(Level.FINE,"String_Node_Str" + splitNum);
      final V split=splits[splitNum];
      final String[] locations=split.getLocations();
      final NumberedSplit<V> numberedSplit=new NumberedSplit<V>(split,splitNum);
      unallocatedSplits.add(numberedSplit);
      for (      final String location : locations) {
        BlockingQueue<NumberedSplit<V>> newSplitQue=new LinkedBlockingQueue<NumberedSplit<V>>();
        final BlockingQueue<NumberedSplit<V>> splitQue=locationToSplits.putIfAbsent(location,newSplitQue);
        if (splitQue != null) {
          newSplitQue=splitQue;
        }
        newSplitQue.add(numberedSplit);
      }
    }
    for (    Map.Entry<String,BlockingQueue<NumberedSplit<V>>> locSplit : locationToSplits.entrySet()) {
      LOG.log(Level.FINE,locSplit.getKey() + "String_Node_Str" + locSplit.getValue().toString());
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 59726
Project: 59726
Buggy source:
@Override public Configuration getConfiguration(AllocatedEvaluator allocatedEvaluator){
  try {
    final NumberedSplit<InputSplit> numberedSplit=evaluatorToPartitionMapper.getInputSplit(allocatedEvaluator.getId());
    final Configuration contextIdConfiguration=ContextConfiguration.CONF.set(ContextConfiguration.IDENTIFIER,"String_Node_Str" + numberedSplit.getIndex()).build();
    final Tang tang=Tang.Factory.getTang();
    final JavaConfigurationBuilder jcb=tang.newConfigurationBuilder(contextIdConfiguration);
    if (inMemory) {
      jcb.bindImplementation(DataSet.class,InMemoryInputFormatDataSet.class);
    }
 else {
      jcb.bindImplementation(DataSet.class,InputFormatDataSet.class);
    }
    jcb.bindNamedParameter(InputFormatExternalConstructor.SerializedJobConf.class,serializedJobConf);
    jcb.bindNamedParameter(InputSplitExternalConstructor.SerializedInputSplit.class,WritableSerializer.serialize(numberedSplit.getEntry()));
    jcb.bindConstructor(InputSplit.class,(Class<? extends ExternalConstructor<InputSplit>>)InputSplitExternalConstructor.class);
    return jcb.build();
  }
 catch (  BindException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public Configuration getConfiguration(AllocatedEvaluator allocatedEvaluator){
  try {
    final NumberedSplit<InputSplit> numberedSplit=evaluatorToPartitionMapper.getInputSplit(allocatedEvaluator.getEvaluatorDescriptor().getNodeDescriptor().getName(),allocatedEvaluator.getId());
    final Configuration contextIdConfiguration=ContextConfiguration.CONF.set(ContextConfiguration.IDENTIFIER,"String_Node_Str" + numberedSplit.getIndex()).build();
    final Tang tang=Tang.Factory.getTang();
    final JavaConfigurationBuilder jcb=tang.newConfigurationBuilder(contextIdConfiguration);
    if (inMemory) {
      jcb.bindImplementation(DataSet.class,InMemoryInputFormatDataSet.class);
    }
 else {
      jcb.bindImplementation(DataSet.class,InputFormatDataSet.class);
    }
    jcb.bindNamedParameter(InputFormatExternalConstructor.SerializedJobConf.class,serializedJobConf);
    jcb.bindNamedParameter(InputSplitExternalConstructor.SerializedInputSplit.class,WritableSerializer.serialize(numberedSplit.getEntry()));
    jcb.bindConstructor(InputSplit.class,(Class<? extends ExternalConstructor<InputSplit>>)InputSplitExternalConstructor.class);
    return jcb.build();
  }
 catch (  BindException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 59727
Project: 59727
Buggy source:
@Override public byte[] call(final byte[] arg0) throws Exception {
  int numEx=0;
  for (  final Pair<?,?> keyValue : dataSet) {
    ++numEx;
  }
  return Integer.toString(numEx).getBytes();
}

Fixed version (ground truth):
@Override public byte[] call(final byte[] arg0) throws Exception {
  int numEx=0;
  for (  final Pair<?,?> keyValue : dataSet) {
    LOG.finest(keyValue.toString());
    ++numEx;
  }
  return Integer.toString(numEx).getBytes();
}
Program: 59728
Project: 59728
Buggy source:
@Override public Pair<K,V> next(){
  fetchRecord();
  return new Pair<K,V>(key,value);
}

Fixed version (ground truth):
@Override public Pair<K,V> next(){
  Pair<K,V> retPair=new Pair<K,V>(key,value);
  fetchRecord();
  return retPair;
}
Program: 59729
Project: 59729
Buggy source:
@Inject public InputFormatLoadingService(InputFormat<K,V> inputFormat,@Parameter(InputFormatExternalConstructor.SerializedJobConf.class) String serializedJobConf,@Parameter(DataLoadingRequestBuilder.NumberOfDesiredSplits.class) int numberOfDesiredSplits,@Parameter(DataLoadingRequestBuilder.LoadDataIntoMemory.class) boolean inMemory){
  this.serializedJobConf=serializedJobConf;
  this.inMemory=inMemory;
  final JobConf jobConf=WritableSerializer.deserialize(serializedJobConf);
  try {
    final InputSplit[] inputSplits=inputFormat.getSplits(jobConf,numberOfDesiredSplits);
    this.numberOfPartitions=inputSplits.length;
    LOG.info("String_Node_Str" + numberOfPartitions);
    this.evaluatorToPartitionMapper=new EvaluatorToPartitionMapper<>(inputSplits);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Inject public InputFormatLoadingService(InputFormat<K,V> inputFormat,@Parameter(InputFormatExternalConstructor.SerializedJobConf.class) String serializedJobConf,@Parameter(DataLoadingRequestBuilder.NumberOfDesiredSplits.class) int numberOfDesiredSplits,@Parameter(DataLoadingRequestBuilder.LoadDataIntoMemory.class) boolean inMemory){
  this.serializedJobConf=serializedJobConf;
  this.inMemory=inMemory;
  final JobConf jobConf=WritableSerializer.deserialize(serializedJobConf);
  try {
    final InputSplit[] inputSplits=inputFormat.getSplits(jobConf,numberOfDesiredSplits);
    for (    InputSplit inputSplit : inputSplits) {
      LOG.info("String_Node_Str" + inputSplit.toString());
    }
    this.numberOfPartitions=inputSplits.length;
    LOG.info("String_Node_Str" + numberOfPartitions);
    this.evaluatorToPartitionMapper=new EvaluatorToPartitionMapper<>(inputSplits);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 59730
Project: 59730
Buggy source:
/** 
 * Get an input split to be assigned to this evaluator Allocates one if its not already allocated
 * @param evaluatorId
 * @return
 */
public NumberedSplit<V> getInputSplit(final String evaluatorId){
synchronized (evaluatorToSplits) {
    if (evaluatorToSplits.containsKey(evaluatorId)) {
      LOG.log(Level.FINE,"String_Node_Str");
      LOG.log(Level.FINE,evaluatorToSplits.toString());
      return evaluatorToSplits.get(evaluatorId);
    }
  }
  LOG.log(Level.FINE,"String_Node_Str");
  if (locationToSplits.containsKey(evaluatorId)) {
    LOG.log(Level.FINE,"String_Node_Str" + evaluatorId);
    final NumberedSplit<V> split=allocateSplit(evaluatorId,locationToSplits.get(evaluatorId));
    LOG.log(Level.FINE,evaluatorToSplits.toString());
    if (split != null) {
      return split;
    }
  }
  LOG.log(Level.FINE,evaluatorId + "String_Node_Str");
  final NumberedSplit<V> split=allocateSplit(evaluatorId,unallocatedSplits);
  LOG.log(Level.FINE,evaluatorToSplits.toString());
  if (split != null) {
    return split;
  }
  throw new RuntimeException("String_Node_Str" + evaluatorId);
}

Fixed version (ground truth):
/** 
 * Get an input split to be assigned to this evaluator Allocates one if its not already allocated
 * @param evaluatorId
 * @return
 */
public NumberedSplit<V> getInputSplit(final String hostName,final String evaluatorId){
synchronized (evaluatorToSplits) {
    if (evaluatorToSplits.containsKey(evaluatorId)) {
      LOG.log(Level.FINE,"String_Node_Str");
      LOG.log(Level.FINE,evaluatorToSplits.toString());
      return evaluatorToSplits.get(evaluatorId);
    }
  }
  LOG.log(Level.FINE,"String_Node_Str");
  if (locationToSplits.containsKey(hostName)) {
    LOG.log(Level.FINE,"String_Node_Str" + evaluatorId + "String_Node_Str"+ hostName);
    final NumberedSplit<V> split=allocateSplit(evaluatorId,locationToSplits.get(hostName));
    LOG.log(Level.FINE,evaluatorToSplits.toString());
    if (split != null) {
      return split;
    }
  }
  LOG.log(Level.FINE,hostName + "String_Node_Str");
  final NumberedSplit<V> split=allocateSplit(evaluatorId,unallocatedSplits);
  LOG.log(Level.FINE,evaluatorToSplits.toString());
  if (split != null) {
    return split;
  }
  throw new RuntimeException("String_Node_Str" + evaluatorId);
}
Program: 59731
Project: 59731
Buggy source:
private NumberedSplit<V> allocateSplit(final String evaluatorId,final BlockingQueue<NumberedSplit<V>> value){
  if (value == null) {
    LOG.log(Level.FINE,"String_Node_Str");
    return null;
  }
  final NumberedSplit<V> split=value.poll();
  if (split != null && (value == unallocatedSplits || unallocatedSplits.remove(split))) {
    LOG.log(Level.FINE,"String_Node_Str" + split.getIndex() + "String_Node_Str");
    final NumberedSplit<V> old=evaluatorToSplits.putIfAbsent(evaluatorId,split);
    if (old != null) {
      final String msg="String_Node_Str" + "String_Node_Str";
      LOG.severe(msg);
      throw new RuntimeException(msg);
    }
 else {
      LOG.log(Level.FINE,"String_Node_Str" + split.getIndex());
      return split;
    }
  }
  return null;
}

Fixed version (ground truth):
private NumberedSplit<V> allocateSplit(final String evaluatorId,final BlockingQueue<NumberedSplit<V>> value){
  if (value == null) {
    LOG.log(Level.FINE,"String_Node_Str");
    return null;
  }
  while (true) {
    final NumberedSplit<V> split=value.poll();
    if (split == null)     return null;
    if (value == unallocatedSplits || unallocatedSplits.remove(split)) {
      LOG.log(Level.FINE,"String_Node_Str" + split.getIndex() + "String_Node_Str");
      final NumberedSplit<V> old=evaluatorToSplits.putIfAbsent(evaluatorId,split);
      if (old != null) {
        final String msg="String_Node_Str" + "String_Node_Str";
        LOG.severe(msg);
        throw new RuntimeException(msg);
      }
 else {
        LOG.log(Level.FINE,"String_Node_Str" + split.getIndex());
        return split;
      }
    }
  }
}
Program: 59732
Project: 59732
Buggy source:
/** 
 * Initializes the locations of splits mapping
 * @param splits
 */
public EvaluatorToPartitionMapper(V[] splits){
  try {
    for (int splitNum=0; splitNum < splits.length; splitNum++) {
      LOG.log(Level.FINE,"String_Node_Str" + splitNum);
      final V split=splits[splitNum];
      final String[] locations=split.getLocations();
      final NumberedSplit<V> numberedSplit=new NumberedSplit<V>(split,splitNum);
      unallocatedSplits.add(numberedSplit);
      for (      final String location : locations) {
        BlockingQueue<NumberedSplit<V>> newSplitQue=new LinkedBlockingQueue<NumberedSplit<V>>();
        final BlockingQueue<NumberedSplit<V>> splitQue=locationToSplits.putIfAbsent(location,newSplitQue);
        if (splitQue != null) {
          newSplitQue=splitQue;
        }
        newSplitQue.add(numberedSplit);
      }
    }
    LOG.log(Level.FINE,locationToSplits.toString());
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the locations of splits mapping
 * @param splits
 */
public EvaluatorToPartitionMapper(V[] splits){
  try {
    for (int splitNum=0; splitNum < splits.length; splitNum++) {
      LOG.log(Level.FINE,"String_Node_Str" + splitNum);
      final V split=splits[splitNum];
      final String[] locations=split.getLocations();
      final NumberedSplit<V> numberedSplit=new NumberedSplit<V>(split,splitNum);
      unallocatedSplits.add(numberedSplit);
      for (      final String location : locations) {
        BlockingQueue<NumberedSplit<V>> newSplitQue=new LinkedBlockingQueue<NumberedSplit<V>>();
        final BlockingQueue<NumberedSplit<V>> splitQue=locationToSplits.putIfAbsent(location,newSplitQue);
        if (splitQue != null) {
          newSplitQue=splitQue;
        }
        newSplitQue.add(numberedSplit);
      }
    }
    for (    Map.Entry<String,BlockingQueue<NumberedSplit<V>>> locSplit : locationToSplits.entrySet()) {
      LOG.log(Level.FINE,locSplit.getKey() + "String_Node_Str" + locSplit.getValue().toString());
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}