nus-yam/ex-repair huggingface dataset:
Program: 55197
Project: 55197
Buggy source:
/** 
 * Source -> Map -> Reduce -> Cross -> Reduce -> Cross -> Reduce -> |--------------------------/                  / |--------------------------------------------/ First cross has SameKeyFirst output contract
 */
@Test public void testTicket158(){
  FileDataSource source=new FileDataSource(DummyInputFormat.class,IN_FILE_1,"String_Node_Str");
  MapContract map=MapContract.builder(IdentityMap.class).name("String_Node_Str").input(source).build();
  ReduceContract reduce1=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(map).build();
  CrossContract cross1=CrossContract.builder(DummyCrossStub.class).name("String_Node_Str").input1(reduce1).input2(source).build();
  ReduceContract reduce2=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(cross1).build();
  CrossContract cross2=CrossContract.builder(DummyCrossStub.class).name("String_Node_Str").input1(reduce2).input2(source).build();
  ReduceContract reduce3=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(cross2).build();
  FileDataSink sink=new FileDataSink(DummyOutputFormat.class,OUT_FILE_1,"String_Node_Str");
  sink.setInput(reduce3);
  Plan plan=new Plan(sink,"String_Node_Str");
  plan.setDefaultParallelism(defaultParallelism);
  OptimizedPlan oPlan=compile(plan);
  NepheleJobGraphGenerator jobGen=new NepheleJobGraphGenerator();
  jobGen.compileJobGraph(oPlan);
}

Fixed version (ground truth):
/** 
 * Source -> Map -> Reduce -> Cross -> Reduce -> Cross -> Reduce -> |--------------------------/                  / |--------------------------------------------/ First cross has SameKeyFirst output contract
 */
@Test public void testTicket158(){
  FileDataSource source=new FileDataSource(DummyInputFormat.class,IN_FILE_1,"String_Node_Str");
  MapContract map=MapContract.builder(IdentityMap.class).name("String_Node_Str").input(source).build();
  ReduceContract reduce1=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(map).build();
  CrossContract cross1=CrossContract.builder(DummyCrossStub.class).name("String_Node_Str").input1(reduce1).input2(source).build();
  ReduceContract reduce2=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(cross1).build();
  CrossContract cross2=CrossContract.builder(DummyCrossStub.class).name("String_Node_Str").input1(reduce2).input2(source).build();
  ReduceContract reduce3=ReduceContract.builder(IdentityReduce.class,PactInteger.class,0).name("String_Node_Str").input(cross2).build();
  FileDataSink sink=new FileDataSink(DummyOutputFormat.class,OUT_FILE_1,"String_Node_Str");
  sink.setInput(reduce3);
  Plan plan=new Plan(sink,"String_Node_Str");
  plan.setDefaultParallelism(DEFAULT_PARALLELISM);
  OptimizedPlan oPlan=compile(plan);
  NepheleJobGraphGenerator jobGen=new NepheleJobGraphGenerator();
  jobGen.compileJobGraph(oPlan);
}
Program: 55198
Project: 55198
Buggy source:
@Test public void testCompileConnectedComponents(){
  WorksetConnectedComponents cc=new WorksetConnectedComponents();
  Plan plan=cc.getPlan(String.valueOf(defaultParallelism),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(100));
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}

Fixed version (ground truth):
@Test public void testCompileConnectedComponents(){
  WorksetConnectedComponents cc=new WorksetConnectedComponents();
  Plan plan=cc.getPlan(String.valueOf(DEFAULT_PARALLELISM),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(100));
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}
Program: 55199
Project: 55199
Buggy source:
public void testCompileKMeansIteration2(){
  IterativeKMeans kmi=new IterativeKMeans();
  Plan plan=kmi.getPlan(String.valueOf(defaultParallelism),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(20));
  setParameterToCross(plan,"String_Node_Str","String_Node_Str");
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}

Fixed version (ground truth):
public void testCompileKMeansIteration2(){
  IterativeKMeans kmi=new IterativeKMeans();
  Plan plan=kmi.getPlan(String.valueOf(DEFAULT_PARALLELISM),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(20));
  setParameterToCross(plan,"String_Node_Str","String_Node_Str");
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}
Program: 55200
Project: 55200
Buggy source:
public void testCompileKMeansIteration1(){
  IterativeKMeans kmi=new IterativeKMeans();
  Plan plan=kmi.getPlan(String.valueOf(defaultParallelism),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(20));
  setParameterToCross(plan,"String_Node_Str","String_Node_Str");
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}

Fixed version (ground truth):
public void testCompileKMeansIteration1(){
  IterativeKMeans kmi=new IterativeKMeans();
  Plan plan=kmi.getPlan(String.valueOf(DEFAULT_PARALLELISM),IN_FILE_1,IN_FILE_1,OUT_FILE_1,String.valueOf(20));
  setParameterToCross(plan,"String_Node_Str","String_Node_Str");
  OptimizedPlan op=compile(plan);
  NepheleJobGraphGenerator jgg=new NepheleJobGraphGenerator();
  jgg.compileJobGraph(op);
}
Program: 55201
Project: 55201
Buggy source:
/** 
 * Filters these properties by what can be preserved through the given output contract.
 * @param contract The output contract.
 * @return True, if any non-default value is preserved, false otherwise.
 */
public GlobalProperties filterByNodesConstantSet(OptimizerNode node,int input){
  if (this.ordering != null) {
    for (    int col : this.ordering.getInvolvedIndexes()) {
      if (!node.isFieldConstant(input,col)) {
        return new GlobalProperties();
      }
    }
  }
 else   if (this.partitioningFields != null) {
    for (    int colIndex : this.partitioningFields) {
      if (!node.isFieldConstant(input,colIndex)) {
        return new GlobalProperties();
      }
    }
  }
  return this;
}

Fixed version (ground truth):
/** 
 * Filters these properties by what can be preserved through the given output contract.
 * @param contract The output contract.
 * @return True, if any non-default value is preserved, false otherwise.
 */
public GlobalProperties filterByNodesConstantSet(OptimizerNode node,int input){
  if (this.ordering != null) {
    for (    int col : this.ordering.getInvolvedIndexes()) {
      if (!node.isFieldConstant(input,col)) {
        return new GlobalProperties();
      }
    }
  }
  if (this.partitioningFields != null) {
    for (    int colIndex : this.partitioningFields) {
      if (!node.isFieldConstant(input,colIndex)) {
        return new GlobalProperties();
      }
    }
  }
  if (this.uniqueFieldCombinations != null) {
    HashSet<FieldSet> newSet=new HashSet<FieldSet>();
    newSet.addAll(this.uniqueFieldCombinations);
    for (Iterator<FieldSet> combos=newSet.iterator(); combos.hasNext(); ) {
      FieldSet current=combos.next();
      for (      Integer field : current) {
        if (!node.isFieldConstant(input,field)) {
          combos.remove();
          break;
        }
      }
    }
    if (newSet.size() != this.uniqueFieldCombinations.size()) {
      GlobalProperties gp=clone();
      gp.uniqueFieldCombinations=newSet.isEmpty() ? null : newSet;
      return gp;
    }
  }
  return this;
}
Program: 55202
Project: 55202
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int getMaximumNumberOfSubtasks(){
  if (!(this.format instanceof FileOutputFormat)) {
    return -1;
  }
  final String pathName=this.config.getStubParameter(FileOutputFormat.FILE_PARAMETER_KEY,null);
  final Path path;
  if (pathName == null) {
    return 0;
  }
  try {
    path=new Path(pathName);
  }
 catch (  Throwable t) {
    return 0;
  }
  try {
    final FileSystem fs=path.getFileSystem();
    try {
      final FileStatus f=fs.getFileStatus(path);
      if (f == null) {
        return 1;
      }
      if (f.isDir()) {
        return -1;
      }
 else {
        fs.delete(path,false);
        return -1;
      }
    }
 catch (    FileNotFoundException fnfex) {
      int dop=getTaskConfiguration().getInteger(DEGREE_OF_PARALLELISM_KEY,-1);
      if (dop == 1) {
        return 1;
      }
      fs.mkdirs(path);
      return -1;
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    return 1;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int getMaximumNumberOfSubtasks(){
  if (!(this.format instanceof FileOutputFormat)) {
    return -1;
  }
  final String pathName=this.config.getStubParameter(FileOutputFormat.FILE_PARAMETER_KEY,null);
  final Path path;
  if (pathName == null) {
    return 0;
  }
  try {
    path=new Path(pathName);
  }
 catch (  Throwable t) {
    return 0;
  }
  try {
    final FileSystem fs=path.getFileSystem();
    try {
      final FileStatus f=fs.getFileStatus(path);
      if (f == null) {
        return 1;
      }
      if (f.isDir()) {
        return -1;
      }
 else {
        fs.delete(path,false);
        int dop=getTaskConfiguration().getInteger(DEGREE_OF_PARALLELISM_KEY,-1);
        if (dop == 1) {
          return 1;
        }
 else {
          fs.mkdirs(path);
          return -1;
        }
      }
    }
 catch (    FileNotFoundException fnfex) {
      int dop=getTaskConfiguration().getInteger(DEGREE_OF_PARALLELISM_KEY,-1);
      if (dop == 1) {
        return 1;
      }
      fs.mkdirs(path);
      return -1;
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
    return 1;
  }
}
Program: 55203
Project: 55203
Buggy source:
@Override public void close() throws IOException {
  this.stream.write(this.buffer,0,this.pos);
  super.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  if (this.stream != null) {
    this.stream.write(this.buffer,0,this.pos);
  }
  super.close();
}
Program: 55204
Project: 55204
Buggy source:
public <T extends Value>Class<? extends ConvergenceCriterion<T>> getConvergenceCriterion(){
  @SuppressWarnings("String_Node_Str") Class<? extends ConvergenceCriterion<T>> clazz=(Class<? extends ConvergenceCriterion<T>>)this.config.getClass(ITERATION_CONVERGENCE_CRITERION,null,ConvergenceCriterion.class);
  if (clazz == null) {
    throw new NullPointerException();
  }
  return clazz;
}

Fixed version (ground truth):
public <T extends Value>Class<? extends ConvergenceCriterion<T>> getConvergenceCriterion(){
  @SuppressWarnings("String_Node_Str") Class<? extends ConvergenceCriterion<T>> clazz=(Class<? extends ConvergenceCriterion<T>>)(Class<?>)this.config.getClass(ITERATION_CONVERGENCE_CRITERION,null,ConvergenceCriterion.class);
  if (clazz == null) {
    throw new NullPointerException();
  }
  return clazz;
}
Program: 55205
Project: 55205
Buggy source:
/** 
 * Unassigns a cloud instance from the job.
 * @param instance the cloud instance which will be unassigned
 * @return <code>true</code> if the given cloud instance has been assigned to the job, <code>false</code> otherwise
 */
public boolean unassignInstanceFromJob(final AbstractInstance instance){
synchronized (this.assignedInstances) {
    return (this.assignedInstances.remove(instance) != null);
  }
}

Fixed version (ground truth):
/** 
 * Unassigns a cloud instance from the job.
 * @param instance the cloud instance which will be unassigned
 * @return <code>true</code> if the given cloud instance has been assigned to the job, <code>false</code> otherwise
 */
public boolean unassignInstanceFromJob(final AbstractInstance instance){
synchronized (this.assignedInstances) {
    return (this.assignedInstances.remove(instance.getInstanceConnectionInfo()) != null);
  }
}
Program: 55208
Project: 55208
Buggy source:
/** 
 * Queries the task manager about the cache status of the libraries stated in the   {@link LibraryCacheProfileRequest}object.
 * @param request a  {@link LibraryCacheProfileRequest} containing a list of libraries whose cache status is to be determined
 * @return a {@link LibraryCacheProfileResponse} containing the cache status for each library included in therequest
 * @throws IOException thrown if an error occurs during this remote procedure call
 */
LibraryCacheProfileResponse getLibraryCacheProfile(LibraryCacheProfileRequest request) throws IOException ;

Fixed version (ground truth):
/** 
 * Queries the task manager about the cache status of the libraries stated in the   {@link LibraryCacheProfileRequest}object.
 * @param request a  {@link LibraryCacheProfileRequest} containing a list of libraries whose cache status is to be determined
 * @return a {@link LibraryCacheProfileResponse} containing the cache status for each library included in therequest
 * @throws IOException thrown if an error occurs during this remote procedure call
 */
LibraryCacheProfileResponse getLibraryCacheProfile(LibraryCacheProfileRequest request) throws IOException, InterruptedException ;
Program: 55209
Project: 55209
Buggy source:
/** 
 * Updates the task manager's library cache.
 * @param update a  {@link LibraryCacheUpdate} object used to transmit the library data
 * @throws IOException thrown if an error occurs during this remote procedure call
 */
void updateLibraryCache(LibraryCacheUpdate update) throws IOException ;

Fixed version (ground truth):
/** 
 * Updates the task manager's library cache.
 * @param update a  {@link LibraryCacheUpdate} object used to transmit the library data
 * @throws IOException thrown if an error occurs during this remote procedure call
 */
void updateLibraryCache(LibraryCacheUpdate update) throws IOException, InterruptedException ;
Program: 55210
Project: 55210
Buggy source:
/** 
 * Queries the state of the given job.
 * @param jobId the job id
 * @return the {@link ExecutionResponse} with the state
 */
public ExecutionResponse getState(SopremoID jobId);

Fixed version (ground truth):
/** 
 * Queries the state of the given job.
 * @param jobId the job id
 * @return the {@link ExecutionResponse} with the state
 */
ExecutionResponse getState(SopremoID jobId) throws IOException, InterruptedException ;
Program: 55211
Project: 55211
Buggy source:
/** 
 * Executes the query specified in the   {@link ExecutionRequest}.
 * @param request the request with the query
 * @return the {@link ExecutionResponse}
 */
public ExecutionResponse execute(ExecutionRequest request);

Fixed version (ground truth):
/** 
 * Executes the query specified in the   {@link ExecutionRequest}.
 * @param request the request with the query
 * @return the {@link ExecutionResponse}
 */
ExecutionResponse execute(ExecutionRequest request) throws IOException, InterruptedException ;
Program: 55212
Project: 55212
Buggy source:
private void startServer() throws IOException {
  InetSocketAddress rpcServerAddress=getServerAddress();
  this.rpcService=new RPCService(rpcServerAddress.getPort(),null);
}

Fixed version (ground truth):
private void startServer() throws IOException {
  InetSocketAddress rpcServerAddress=getServerAddress();
  this.rpcService=new RPCService(rpcServerAddress.getPort(),2,null);
  this.rpcService.setProtocolCallbackHandler(SopremoExecutionProtocol.class,this);
}
Program: 55213
Project: 55213
Buggy source:
@Test public void testSuccessfulExecution() throws IOException {
  final SopremoPlan plan=createPlan("String_Node_Str");
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.FINISHED,response.getState());
  Assert.assertSame("String_Node_Str",response.getDetails());
  this.testServer.checkContentsOf("String_Node_Str",JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",32500,"String_Node_Str",false),JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",72000,"String_Node_Str",true));
}

Fixed version (ground truth):
@Test public void testSuccessfulExecution() throws IOException, InterruptedException {
  final SopremoPlan plan=createPlan("String_Node_Str");
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.FINISHED,response.getState());
  Assert.assertSame("String_Node_Str",response.getDetails());
  this.testServer.checkContentsOf("String_Node_Str",JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",32500,"String_Node_Str",false),JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",72000,"String_Node_Str",true));
}
Program: 55214
Project: 55214
Buggy source:
@Test public void testFailIfInvalidPlan(){
  final SopremoPlan plan=new SopremoPlan();
  plan.setSinks(new Sink("String_Node_Str"));
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}

Fixed version (ground truth):
@Test public void testFailIfInvalidPlan() throws IOException, InterruptedException {
  final SopremoPlan plan=new SopremoPlan();
  plan.setSinks(new Sink("String_Node_Str"));
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}
Program: 55215
Project: 55215
Buggy source:
private ExecutionResponse waitForStateToFinish(ExecutionResponse response,ExecutionState status){
  return SopremoTestServer.waitForStateToFinish(this.testServer,response,status);
}

Fixed version (ground truth):
private ExecutionResponse waitForStateToFinish(ExecutionResponse response,ExecutionState status) throws IOException, InterruptedException {
  return SopremoTestServer.waitForStateToFinish(this.testServer,response,status);
}
Program: 55216
Project: 55216
Buggy source:
@Test public void testFailIfSubmissionFails() throws IOException {
  this.testServer.delete("String_Node_Str",true);
  final SopremoPlan plan=createPlan("String_Node_Str");
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}

Fixed version (ground truth):
@Test public void testFailIfSubmissionFails() throws IOException, InterruptedException {
  this.testServer.delete("String_Node_Str",true);
  final SopremoPlan plan=createPlan("String_Node_Str");
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}
Program: 55217
Project: 55217
Buggy source:
@Test public void testMultipleSuccessfulExecutions() throws IOException {
  ExecutionResponse[] responses=new ExecutionResponse[3];
  for (int index=0; index < responses.length; index++) {
    final SopremoPlan plan=createPlan("String_Node_Str" + index + "String_Node_Str");
    responses[index]=this.testServer.execute(new ExecutionRequest(plan));
  }
  for (int index=0; index < responses.length; index++) {
    responses[index]=waitForStateToFinish(responses[index],ExecutionState.ENQUEUED);
    responses[index]=waitForStateToFinish(responses[index],ExecutionState.RUNNING);
    Assert.assertSame(ExecutionState.FINISHED,responses[index].getState());
    Assert.assertSame("String_Node_Str",responses[index].getDetails());
    this.testServer.checkContentsOf("String_Node_Str" + index + "String_Node_Str",JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",32500,"String_Node_Str",false),JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",72000,"String_Node_Str",true));
  }
}

Fixed version (ground truth):
@Test public void testMultipleSuccessfulExecutions() throws IOException, InterruptedException {
  ExecutionResponse[] responses=new ExecutionResponse[3];
  for (int index=0; index < responses.length; index++) {
    final SopremoPlan plan=createPlan("String_Node_Str" + index + "String_Node_Str");
    responses[index]=this.testServer.execute(new ExecutionRequest(plan));
  }
  for (int index=0; index < responses.length; index++) {
    responses[index]=waitForStateToFinish(responses[index],ExecutionState.ENQUEUED);
    responses[index]=waitForStateToFinish(responses[index],ExecutionState.RUNNING);
    Assert.assertSame(ExecutionState.FINISHED,responses[index].getState());
    Assert.assertSame("String_Node_Str",responses[index].getDetails());
    this.testServer.checkContentsOf("String_Node_Str" + index + "String_Node_Str",JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",32500,"String_Node_Str",false),JsonUtil.createObjectNode("String_Node_Str","String_Node_Str","String_Node_Str",72000,"String_Node_Str",true));
  }
}
Program: 55218
Project: 55218
Buggy source:
@Test public void testFailIfRuntimeException(){
  final SopremoPlan plan=createPlan("String_Node_Str");
  for (  Operator<?> op : plan.getContainedOperators())   if (op instanceof Selection)   ((Selection)op).setCondition(new UnaryExpression(new UnevaluableExpression("String_Node_Str")));
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}

Fixed version (ground truth):
@Test public void testFailIfRuntimeException() throws IOException, InterruptedException {
  final SopremoPlan plan=createPlan("String_Node_Str");
  for (  Operator<?> op : plan.getContainedOperators())   if (op instanceof Selection)   ((Selection)op).setCondition(new UnaryExpression(new UnevaluableExpression("String_Node_Str")));
  ExecutionResponse response=this.testServer.execute(new ExecutionRequest(plan));
  response=waitForStateToFinish(response,ExecutionState.ENQUEUED);
  response=waitForStateToFinish(response,ExecutionState.RUNNING);
  Assert.assertSame(ExecutionState.ERROR,response.getState());
  Assert.assertNotSame("String_Node_Str",response.getDetails());
}
Program: 55219
Project: 55219
Buggy source:
private ExecutionResponse waitForStateToFinish(ExecutionResponse response,ExecutionState status){
  return SopremoTestServer.waitForStateToFinish(this.server,response,status);
}

Fixed version (ground truth):
private ExecutionResponse waitForStateToFinish(ExecutionResponse response,ExecutionState status){
  try {
    return SopremoTestServer.waitForStateToFinish(this.server,response,status);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 55220
Project: 55220
Buggy source:
public static ExecutionResponse waitForStateToFinish(SopremoExecutionProtocol server,ExecutionResponse response,ExecutionState status){
  for (int waits=0; response.getState() == status && waits < 1000; waits++) {
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
    }
    response=server.getState(response.getJobId());
  }
  return response;
}

Fixed version (ground truth):
public static ExecutionResponse waitForStateToFinish(SopremoExecutionProtocol server,ExecutionResponse response,ExecutionState status) throws IOException, InterruptedException {
  for (int waits=0; response.getState() == status && waits < 1000; waits++) {
    Thread.sleep(100);
    response=server.getState(response.getJobId());
  }
  return response;
}
Program: 55221
Project: 55221
Buggy source:
@Override public ExecutionResponse execute(ExecutionRequest request){
  correctPathsOfPlan(request.getQuery());
  return this.executor.execute(request);
}

Fixed version (ground truth):
@Override public ExecutionResponse execute(ExecutionRequest request) throws IOException, InterruptedException {
  correctPathsOfPlan(request.getQuery());
  return this.executor.execute(request);
}
Program: 55222
Project: 55222
Buggy source:
@Override public ExecutionResponse getState(SopremoID jobId){
  return this.executor.getState(jobId);
}

Fixed version (ground truth):
@Override public ExecutionResponse getState(SopremoID jobId) throws IOException, InterruptedException {
  return this.executor.getState(jobId);
}
Program: 55223
Project: 55223
Buggy source:
/** 
 * Tries to read the AWS access key and the AWS secret key from the environments variables. If accessing these keys fails, all tests will be skipped and marked as successful.
 */
@Before public void initKeys(){
  final String accessKey=System.getenv("String_Node_Str");
  final String secretKey=System.getenv("String_Node_Str");
  final Configuration conf=new Configuration();
  conf.setString(S3FileSystem.S3_ACCESS_KEY_KEY,accessKey);
  conf.setString(S3FileSystem.S3_SECRET_KEY_KEY,secretKey);
  GlobalConfiguration.includeConfiguration(conf);
}

Fixed version (ground truth):
/** 
 * Tries to read the AWS access key and the AWS secret key from the environments variables. If accessing these keys fails, all tests will be skipped and marked as successful.
 */
@Before public void initKeys(){
  final String accessKey=System.getenv("String_Node_Str");
  final String secretKey=System.getenv("String_Node_Str");
  final Configuration conf=new Configuration();
  if (accessKey != null) {
    conf.setString(S3FileSystem.S3_ACCESS_KEY_KEY,accessKey);
  }
  if (secretKey != null) {
    conf.setString(S3FileSystem.S3_SECRET_KEY_KEY,secretKey);
  }
  GlobalConfiguration.includeConfiguration(conf);
}
Program: 55224
Project: 55224
Buggy source:
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final List<Class<?>> types=ManagementTypeUtils.getRPCTypesToRegister();
  types.add(AbstractTaskResult.ReturnCode.class);
  types.add(ChannelDeploymentDescriptor.class);
  types.add(CheckpointState.class);
  types.add(ConnectionInfoLookupResponse.class);
  types.add(ConnectionInfoLookupResponse.ReturnCode.class);
  types.add(ExecutionVertexID.class);
  types.add(FileInputSplit.class);
  types.add(GateDeploymentDescriptor.class);
  types.add(HashSet.class);
  types.add(Inet4Address.class);
  types.add(InetSocketAddress.class);
  types.add(InputSplitWrapper.class);
  types.add(InstanceConnectionInfo.class);
  types.add(LocalInstance.class);
  types.add(RemoteReceiver.class);
  types.add(TaskCancelResult.class);
  types.add(TaskCheckpointState.class);
  types.add(TaskDeploymentDescriptor.class);
  types.add(TaskExecutionState.class);
  types.add(TaskSubmissionResult.class);
  return types;
}

Fixed version (ground truth):
/** 
 * Returns a list of types frequently used by the RPC protocols of this package and its parent packages.
 * @return a list of types frequently used by the RPC protocols of this package
 */
public static List<Class<?>> getRPCTypesToRegister(){
  final List<Class<?>> types=ManagementTypeUtils.getRPCTypesToRegister();
  types.add(AbstractTaskResult.ReturnCode.class);
  types.add(ChannelDeploymentDescriptor.class);
  types.add(CheckpointState.class);
  types.add(ConnectionInfoLookupResponse.class);
  types.add(ConnectionInfoLookupResponse.ReturnCode.class);
  types.add(ExecutionVertexID.class);
  types.add(FileInputSplit.class);
  types.add(GateDeploymentDescriptor.class);
  types.add(GenericInputSplit.class);
  types.add(HashSet.class);
  types.add(Inet4Address.class);
  types.add(InetSocketAddress.class);
  types.add(InputSplitWrapper.class);
  types.add(InstanceConnectionInfo.class);
  types.add(LocalInstance.class);
  types.add(RemoteReceiver.class);
  types.add(TaskCancelResult.class);
  types.add(TaskCheckpointState.class);
  types.add(TaskDeploymentDescriptor.class);
  types.add(TaskExecutionState.class);
  types.add(TaskSubmissionResult.class);
  return types;
}
Program: 55225
Project: 55225
Buggy source:
private static void addBasicRPCTypes(final List<Class<?>> typesToRegister){
  typesToRegister.add(ArrayList.class);
  typesToRegister.add(AssertionError.class);
  typesToRegister.add(boolean[].class);
  typesToRegister.add(Class.class);
  typesToRegister.add(Class[].class);
  typesToRegister.add(IllegalArgumentException.class);
  typesToRegister.add(KryoException.class);
  typesToRegister.add(List.class);
  typesToRegister.add(Object[].class);
  typesToRegister.add(RPCEnvelope.class);
  typesToRegister.add(RPCRequest.class);
  typesToRegister.add(RPCReturnValue.class);
  typesToRegister.add(RPCCleanup.class);
  typesToRegister.add(RPCThrowable.class);
  typesToRegister.add(StackTraceElement[].class);
  typesToRegister.add(String[].class);
  typesToRegister.add(StringBuffer.class);
}

Fixed version (ground truth):
private static void addBasicRPCTypes(final List<Class<?>> typesToRegister){
  typesToRegister.add(ArrayList.class);
  typesToRegister.add(AssertionError.class);
  typesToRegister.add(boolean[].class);
  typesToRegister.add(Class.class);
  typesToRegister.add(Class[].class);
  typesToRegister.add(IllegalArgumentException.class);
  typesToRegister.add(InterruptedException.class);
  typesToRegister.add(IOException.class);
  typesToRegister.add(KryoException.class);
  typesToRegister.add(List.class);
  typesToRegister.add(Object[].class);
  typesToRegister.add(RPCEnvelope.class);
  typesToRegister.add(RPCRequest.class);
  typesToRegister.add(RPCReturnValue.class);
  typesToRegister.add(RPCCleanup.class);
  typesToRegister.add(RPCThrowable.class);
  typesToRegister.add(StackTraceElement.class);
  typesToRegister.add(StackTraceElement[].class);
  typesToRegister.add(String[].class);
  typesToRegister.add(StringBuffer.class);
}
Program: 55227
Project: 55227
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected Kryo initialValue(){
  final Kryo kryo=new Kryo();
  if (kryoTypesToRegister != null) {
    kryo.setAutoReset(false);
    kryo.setRegistrationRequired(true);
    kryo.setReferences(true);
    for (    final Class<?> kryoType : kryoTypesToRegister) {
      kryo.register(kryoType);
    }
  }
  return kryo;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected Kryo initialValue(){
  final Kryo kryo=new Kryo();
  if (kryoTypesToRegister != null) {
    kryo.setAutoReset(false);
    kryo.setRegistrationRequired(true);
    kryo.setReferences(true);
    kryo.addDefaultSerializer(StackTraceElement.class,new StackTraceElementSerializer());
    for (    final Class<?> kryoType : kryoTypesToRegister) {
      kryo.register(kryoType);
    }
  }
  return kryo;
}
Program: 55228
Project: 55228
Buggy source:
@Override public int testMethod(final boolean par1,final int par2,final List<String> par3){
  if (par1) {
    assertEquals(this.counter.getAndIncrement(),par2);
  }
  assertEquals(NUMBER_OF_TEST_STRINGS,par3.size());
  for (int i=0; i < NUMBER_OF_TEST_STRINGS; ++i) {
    assertEquals(constructTestString(i),par3.get(i));
  }
  if (!this.processedRequestsSet.add(Integer.valueOf(par2))) {
    fail("String_Node_Str" + par2 + "String_Node_Str");
  }
  return par2;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int testMethod(final boolean par1,final int par2,final List<String> par3){
  if (par1) {
    assertEquals(this.counter.getAndIncrement(),par2);
  }
  assertEquals(NUMBER_OF_TEST_STRINGS,par3.size());
  for (int i=0; i < NUMBER_OF_TEST_STRINGS; ++i) {
    assertEquals(constructTestString(i),par3.get(i));
  }
  if (!this.processedRequestsSet.add(Integer.valueOf(par2))) {
    fail("String_Node_Str" + par2 + "String_Node_Str");
  }
  return par2;
}
Program: 55229
Project: 55229
Buggy source:
/** 
 * Registers the   {@link ExecutionStateListener} object for this vertex. This objectwill be notified about particular events during the vertex's lifetime.
 * @param executionListener the object to be notified about particular events during the vertex's lifetime
 */
public void registerExecutionStateListener(final ExecutionStateListener executionStateListener){
  final Integer priority=Integer.valueOf(executionStateListener.getPriority());
  if (priority.intValue() < 0) {
    LOG.error("String_Node_Str" + executionStateListener.getClass() + "String_Node_Str");
    return;
  }
  final ExecutionStateListener previousValue=this.executionStateListeners.putIfAbsent(priority,executionStateListener);
  if (previousValue != null) {
    LOG.error("String_Node_Str" + executionStateListener.getClass() + "String_Node_Str"+ priority.intValue()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Registers the   {@link ExecutionStateListener} object for this vertex. This objectwill be notified about particular events during the vertex's lifetime.
 * @param executionStateListener the object to be notified about particular events during the vertex's lifetime
 */
public void registerExecutionStateListener(final ExecutionStateListener executionStateListener){
  final Integer priority=Integer.valueOf(executionStateListener.getPriority());
  if (priority.intValue() < 0) {
    LOG.error("String_Node_Str" + executionStateListener.getClass() + "String_Node_Str");
    return;
  }
  final ExecutionStateListener previousValue=this.executionStateListeners.putIfAbsent(priority,executionStateListener);
  if (previousValue != null) {
    LOG.error("String_Node_Str" + executionStateListener.getClass() + "String_Node_Str"+ priority.intValue()+ "String_Node_Str");
  }
}
Program: 55230
Project: 55230
Buggy source:
/** 
 * Unregisters the   {@link ExecutionStateListener} object for this vertex. This objectwill no longer be notified about particular events during the vertex's lifetime.
 * @param checkpointStateChangeListener the object to be unregistered
 */
public void unregisterExecutionStateListener(final ExecutionStateListener executionListener){
  this.executionStateListeners.remove(Integer.valueOf(executionListener.getPriority()));
}

Fixed version (ground truth):
/** 
 * Unregisters the   {@link ExecutionStateListener} object for this vertex. This objectwill no longer be notified about particular events during the vertex's lifetime.
 * @param checkpointStateChangeListener the object to be unregistered
 */
public void unregisterExecutionStateListener(final ExecutionStateListener executionStateListener){
  this.executionStateListeners.remove(Integer.valueOf(executionStateListener.getPriority()));
}
Program: 55231
Project: 55231
Buggy source:
/** 
 * Unregisters all previously register   {@link ExecutionObserver} objects forthe vertex identified by the given ID.
 * @param id the ID of the vertex to unregister the  {@link ExecutionListener} objects for
 */
void unregisterExecutionObserver(ExecutionVertexID id);

Fixed version (ground truth):
/** 
 * Unregisters all previously register   {@link ExecutionObserver} objects forthe vertex identified by the given ID.
 * @param id the ID of the vertex to unregister the  {@link ExecutionObserver} objects for
 */
void unregisterExecutionObserver(ExecutionVertexID id);
Program: 55232
Project: 55232
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void startExecution(){
  final ReplayThread thread=this.environment.getExecutingThread();
  if (this.replayThreadStarted.compareAndSet(false,true)) {
    thread.start();
  }
 else {
    thread.restart();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void startExecution(){
  final ReplayThread thread=this.environment.getExecutingThread();
  thread.start();
}
Program: 55237
Project: 55237
Buggy source:
public void executionStateChanged(final JobID jobID,final ExecutionVertexID id,final ExecutionState newExecutionState,final String optionalDescription){
  if (newExecutionState == ExecutionState.CANCELING) {
    return;
  }
  if (newExecutionState == ExecutionState.FINISHED || newExecutionState == ExecutionState.CANCELED || newExecutionState == ExecutionState.FAILED) {
    unregisterTask(id);
  }
  try {
    this.jobManager.updateTaskExecutionState(new TaskExecutionState(jobID,id,newExecutionState,optionalDescription));
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
}

Fixed version (ground truth):
public void executionStateChanged(final JobID jobID,final ExecutionVertexID id,final ExecutionState newExecutionState,final String optionalDescription){
  if (newExecutionState == ExecutionState.CANCELING) {
    return;
  }
  if (newExecutionState == ExecutionState.FINISHED || newExecutionState == ExecutionState.CANCELED || newExecutionState == ExecutionState.FAILED) {
    unregisterTask(id);
  }
  if (newExecutionState == ExecutionState.CANCELED) {
    final Runnable runnable=new Runnable(){
      @Override public void run(){
        try {
          jobManager.updateTaskExecutionState(new TaskExecutionState(jobID,id,newExecutionState,optionalDescription));
        }
 catch (        Exception e) {
          LOG.error(StringUtils.stringifyException(e));
        }
      }
    }
;
    this.executorService.execute(runnable);
    return;
  }
  try {
    jobManager.updateTaskExecutionState(new TaskExecutionState(jobID,id,newExecutionState,optionalDescription));
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
}
Program: 55239
Project: 55239
Buggy source:
@Override public void read(DataInput in) throws IOException {
  workerIndex=in.readInt();
  String classname=in.readUTF();
  try {
    aggregate=Class.forName(classname).asSubclass(Value.class).newInstance();
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
  aggregate.read(in);
}

Fixed version (ground truth):
@Override public void read(DataInput in) throws IOException {
  workerIndex=in.readInt();
  boolean hasAggregate=in.readBoolean();
  if (hasAggregate) {
    String classname=in.readUTF();
    try {
      aggregate=Class.forName(classname).asSubclass(Value.class).newInstance();
    }
 catch (    Exception e) {
      throw new IOException(e);
    }
    aggregate.read(in);
  }
 else {
    aggregate=null;
  }
}
Program: 55240
Project: 55240
Buggy source:
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(workerIndex);
  out.writeUTF(aggregate.getClass().getName());
  aggregate.write(out);
}

Fixed version (ground truth):
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(workerIndex);
  boolean hasAggregate=aggregate != null;
  out.writeBoolean(hasAggregate);
  if (hasAggregate) {
    out.writeUTF(aggregate.getClass().getName());
    aggregate.write(out);
  }
}
Program: 55242
Project: 55242
Buggy source:
private void sendEventToSync(WorkerDoneEvent event) throws IOException, InterruptedException {
  if (log.isInfoEnabled()) {
    log.info(formatLogString("String_Node_Str" + WorkerDoneEvent.class.getSimpleName() + "String_Node_Str"+ event.aggregate()+ "String_Node_Str"));
  }
  getSyncOutput().publishEvent(event);
}

Fixed version (ground truth):
private void sendEventToSync(WorkerDoneEvent event) throws IOException, InterruptedException {
  if (log.isInfoEnabled()) {
    log.info(formatLogString("String_Node_Str" + WorkerDoneEvent.class.getSimpleName() + "String_Node_Str"));
  }
  getSyncOutput().publishEvent(event);
}
Program: 55243
Project: 55243
Buggy source:
/** 
 * Returns either this BooleanNode represents the value <code>true</code> or not.
 */
public boolean getBooleanValue(){
  return this == TRUE;
}

Fixed version (ground truth):
/** 
 * Returns either this BooleanNode represents the value <code>true</code> or not.
 */
public boolean getBooleanValue(){
  return value;
}
Program: 55244
Project: 55244
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public <T extends Record>OutputGate<T> createAndRegisterOutputGate(final ChannelSelector<T> selector,final boolean isBroadcast){
  if (this.unboundOutputGates == null) {
    final RuntimeOutputGate<T> rog=new RuntimeOutputGate<T>(getJobID(),null,getNumberOfOutputGates(),ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,selector,isBroadcast,null);
    this.outputGates.add(rog);
    return rog;
  }
  final GateDeploymentDescriptor gdd=this.unboundOutputGates.poll();
  if (gdd == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  RecordSerializerFactory<T> serializerFactory;
  if (gdd.spanningRecordsAllowed()) {
    serializerFactory=new SpanningRecordSerializerFactory<T>();
  }
 else {
    serializerFactory=new DefaultRecordSerializerFactory<T>();
  }
  final RuntimeOutputGate<T> rog=new RuntimeOutputGate<T>(getJobID(),gdd.getGateID(),getNumberOfInputGates(),gdd.getChannelType(),gdd.getCompressionLevel(),selector,isBroadcast,serializerFactory);
  this.outputGates.add(rog);
  return rog;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public <T extends Record>OutputGate<T> createAndRegisterOutputGate(final ChannelSelector<T> selector,final boolean isBroadcast){
  if (this.unboundOutputGates == null) {
    final RuntimeOutputGate<T> rog=new RuntimeOutputGate<T>(getJobID(),null,getNumberOfOutputGates(),ChannelType.NETWORK,CompressionLevel.NO_COMPRESSION,selector,isBroadcast,null);
    this.outputGates.add(rog);
    return rog;
  }
  final GateDeploymentDescriptor gdd=this.unboundOutputGates.poll();
  if (gdd == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  RecordSerializerFactory<T> serializerFactory;
  if (gdd.spanningRecordsAllowed()) {
    serializerFactory=new SpanningRecordSerializerFactory<T>();
  }
 else {
    serializerFactory=new DefaultRecordSerializerFactory<T>();
  }
  final RuntimeOutputGate<T> rog=new RuntimeOutputGate<T>(getJobID(),gdd.getGateID(),getNumberOfOutputGates(),gdd.getChannelType(),gdd.getCompressionLevel(),selector,isBroadcast,serializerFactory);
  this.outputGates.add(rog);
  return rog;
}
Program: 55245
Project: 55245
Buggy source:
/** 
 * Creates a copy of the given object by an in-memory serialization and subsequent deserialization.
 * @param original the original object to be copied
 * @return the copy of original object
 */
public static <T>T createCopy(final T original){
  final Kryo kryo=new Kryo();
  return (T)kryo.copy(original);
}

Fixed version (ground truth):
/** 
 * Creates a copy of the given object by an in-memory serialization and subsequent deserialization.
 * @param original the original object to be copied
 * @return the copy of original object
 */
@SuppressWarnings("String_Node_Str") public static <T>T createCopy(final T original){
  final Kryo kryo=new Kryo();
  final byte[] buf=new byte[8192];
  final Output output=new Output(buf);
  kryo.writeObject(output,original);
  output.flush();
  final Input input=new Input(buf);
  return (T)kryo.readObject(input,original.getClass());
}
Program: 55247
Project: 55247
Buggy source:
@Override public void invoke() throws Exception {
  while (!terminationRequested()) {
    notifyMonitor(IterationMonitoring.Event.SYNC_STARTING,currentIteration);
    if (log.isInfoEnabled()) {
      log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
    }
    readHeadEventChannel();
    if (log.isInfoEnabled()) {
      log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
    }
    if (checkForConvergence()) {
      if (log.isInfoEnabled()) {
        log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
      }
      requestTermination();
      sendToAllWorkers(new TerminationEvent());
      notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED,currentIteration);
    }
 else {
      if (log.isInfoEnabled()) {
        log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
      }
      AllWorkersDoneEvent allWorkersDoneEvent=taskConfig.usesConvergenceCriterion() ? new AllWorkersDoneEvent(aggregator.getAggregate()) : new AllWorkersDoneEvent();
      aggregator.reset();
      sendToAllWorkers(allWorkersDoneEvent);
      notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED,currentIteration);
      currentIteration++;
    }
  }
}

Fixed version (ground truth):
@Override public void invoke() throws Exception {
  while (!terminationRequested()) {
    notifyMonitor(IterationMonitoring.Event.SYNC_STARTING,currentIteration);
    if (log.isInfoEnabled()) {
      log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
    }
    readHeadEventChannel();
    if (log.isInfoEnabled()) {
      log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
    }
    if (checkForConvergence()) {
      if (log.isInfoEnabled()) {
        log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
      }
      requestTermination();
      sendToAllWorkers(new TerminationEvent());
      notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED,currentIteration);
    }
 else {
      if (log.isInfoEnabled()) {
        log.info(formatLogString("String_Node_Str" + currentIteration + "String_Node_Str"));
      }
      AllWorkersDoneEvent allWorkersDoneEvent=taskConfig.usesConvergenceCriterion() ? new AllWorkersDoneEvent(aggregator.getAggregate()) : new AllWorkersDoneEvent();
      if (taskConfig.usesConvergenceCriterion()) {
        aggregator.reset();
      }
      sendToAllWorkers(allWorkersDoneEvent);
      notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED,currentIteration);
      currentIteration++;
    }
  }
}
Program: 55248
Project: 55248
Buggy source:
/** 
 * Checks if the given new execution state of the   {@link ExecutionVertex} also leads to a new execution state of thethis group vertex. If so, the group vertex will update it's execution state and notify the registered {@link GroupExecutionListener} objects about the state change.
 * @param newExecutionState the new execution state of the  {@link ExecutionVertex}
 * @param optionalMessage an optional message providing additional information about the state change
 */
void updateGroupExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (newExecutionState == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (allMembersMustShareState(newExecutionState)) {
    final Iterator<ExecutionVertex> it=this.groupMembers.iterator();
    while (it.hasNext()) {
      if (it.next().getExecutionState() != newExecutionState) {
        return;
      }
    }
  }
  if (this.groupExecutionState.getAndSet(newExecutionState) == newExecutionState) {
    return;
  }
  final Iterator<GroupExecutionListener> it=this.groupExecutionListeners.iterator();
  while (it.hasNext()) {
    it.next().groupExecutionStateChanged(this,newExecutionState,optionalMessage);
  }
}

Fixed version (ground truth):
/** 
 * Checks if the given new execution state of the   {@link ExecutionVertex} also leads to a new execution state of thethis group vertex. If so, the group vertex will update it's execution state and notify the registered {@link GroupExecutionListener} objects about the state change.
 * @param newExecutionState the new execution state of the  {@link ExecutionVertex}
 * @param optionalMessage an optional message providing additional information about the state change
 */
void updateGroupExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (newExecutionState == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (allMembersMustShareState(newExecutionState)) {
    final Iterator<ExecutionVertex> it=this.groupMembers.iterator();
    while (it.hasNext()) {
      final ExecutionState es=it.next().getExecutionState();
      if (es != newExecutionState && es != ExecutionState.FAILED) {
        return;
      }
    }
  }
  if (this.groupExecutionState.getAndSet(newExecutionState) == newExecutionState) {
    return;
  }
  final Iterator<GroupExecutionListener> it=this.groupExecutionListeners.iterator();
  while (it.hasNext()) {
    it.next().groupExecutionStateChanged(this,newExecutionState,optionalMessage);
  }
}