nus-yam/ex-repair huggingface dataset:
Program: 87643
Project: 87643
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  final InetAddress ia=this.connectionAddress.getAddress();
  out.writeInt(ia.getAddress().length);
  out.write(ia.getAddress());
  out.write(this.connectionAddress.getPort());
  out.writeInt(this.connectionIndex);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  final InetAddress ia=this.connectionAddress.getAddress();
  out.writeInt(ia.getAddress().length);
  out.write(ia.getAddress());
  out.writeInt(this.connectionAddress.getPort());
  out.writeInt(this.connectionIndex);
}
Program: 87644
Project: 87644
Buggy source:
public void logBufferUtilization(){
  System.out.println("String_Node_Str");
  final Iterator<Map.Entry<InetSocketAddress,OutgoingConnection>> it=this.outgoingConnections.entrySet().iterator();
  while (it.hasNext()) {
    final Map.Entry<InetSocketAddress,OutgoingConnection> entry=it.next();
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue().getNumberOfQueuedWriteBuffers());
  }
}

Fixed version (ground truth):
public void logBufferUtilization(){
  System.out.println("String_Node_Str");
  final Iterator<Map.Entry<RemoteReceiver,OutgoingConnection>> it=this.outgoingConnections.entrySet().iterator();
  while (it.hasNext()) {
    final Map.Entry<RemoteReceiver,OutgoingConnection> entry=it.next();
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue().getNumberOfQueuedWriteBuffers());
  }
}
Program: 87645
Project: 87645
Buggy source:
@Override public IArrayNode add(int index,IJsonNode element){
  if (element == null) {
    throw new NullPointerException();
  }
  if (element.isMissing()) {
    this.remove(index);
  }
  if (index < 0 || index > this.size()) {
    throw new IndexOutOfBoundsException();
  }
  if (index < this.schema.getTailSize()) {
    for (int i=this.schema.getTailSize() - 1; i >= index; i--) {
      if (!this.record.isNull(i)) {
        if (i == this.schema.getTailSize() - 1) {
          this.getOtherField().add(0,SopremoUtil.unwrap(this.record.getField(i,JsonNodeWrapper.class)));
        }
 else {
          this.record.setField(i + 1,this.record.getField(i,JsonNodeWrapper.class));
        }
      }
    }
    this.record.setField(index,SopremoUtil.wrap(element));
  }
  return this;
}

Fixed version (ground truth):
@Override public IArrayNode add(int index,IJsonNode element){
  if (element == null) {
    throw new NullPointerException();
  }
  if (element.isMissing()) {
    this.remove(index);
  }
  if (index < 0 || index > this.size()) {
    throw new IndexOutOfBoundsException();
  }
  int recordPosition=this.schema.getTailSize() - size() + index;
  if (recordPosition < 0) {
    this.getOtherField().add(index,element);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
    IJsonNode tmpNode;
    this.record.setField(recordPosition + 1,SopremoUtil.wrap(element));
    for (int i=recordPosition + 1; i > 0; i--) {
      if (this.record.isNull(i)) {
        this.record.setField(i,SopremoUtil.wrap(oldNode));
        return this;
      }
 else {
        tmpNode=SopremoUtil.unwrap(this.record.getField(i,JsonNodeWrapper.class));
        if (oldNode != null) {
          this.record.setField(i,SopremoUtil.wrap(oldNode));
        }
        oldNode=tmpNode;
      }
    }
    if (oldNode != null) {
      this.getOtherField().add(oldNode);
    }
  }
  return this;
}
Program: 87646
Project: 87646
Buggy source:
@Override public IJsonNode set(int index,IJsonNode node){
  if (node == null) {
    throw new NullPointerException();
  }
  if (node.isMissing()) {
    return this.remove(index);
  }
  if (index < 0 || index >= this.size()) {
    if (index == this.size()) {
      this.add(node);
      return MissingNode.getInstance();
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
  int pactRecordPosition=this.schema.getTailSize() - size() + index;
  if (pactRecordPosition < 0) {
    return this.getOtherField().set(index,node);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(pactRecordPosition + 1,JsonNodeWrapper.class));
    this.record.setField(pactRecordPosition + 1,node);
    return oldNode;
  }
}

Fixed version (ground truth):
@Override public IJsonNode set(int index,IJsonNode node){
  if (node == null) {
    throw new NullPointerException();
  }
  if (node.isMissing()) {
    return this.remove(index);
  }
  if (index < 0 || index >= this.size()) {
    if (index == this.size()) {
      this.add(node);
      return MissingNode.getInstance();
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
  int recordPosition=this.schema.getTailSize() - size() + index;
  if (recordPosition < 0) {
    return this.getOtherField().set(index,node);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
    this.record.setField(recordPosition + 1,node);
    return oldNode;
  }
}
Program: 87647
Project: 87647
Buggy source:
@Override public IJsonNode get(int index){
  int size=this.size();
  if (index < 0 || index >= size) {
    return MissingNode.getInstance();
  }
  if (size <= this.schema.getTailSize()) {
    return SopremoUtil.unwrap(this.record.getField(this.schema.getTailSize() - size + index + 1,JsonNodeWrapper.class));
  }
 else {
    return this.getOtherField().get(index);
  }
}

Fixed version (ground truth):
@Override public IJsonNode get(int index){
  int size=this.size();
  if (index < 0 || index >= size) {
    return MissingNode.getInstance();
  }
  int recordPosition=this.schema.getTailSize() - size + index;
  if (recordPosition >= 0) {
    return SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
  }
 else {
    return this.getOtherField().get(index);
  }
}
Program: 87648
Project: 87648
Buggy source:
@Override public void initArrayNode(){
  TailArraySchema schema=new TailArraySchema();
  schema.setTailSize(5);
  PactRecord record=schema.jsonToRecord(new ArrayNode(IntNode.valueOf(0),IntNode.valueOf(1),IntNode.valueOf(2)),null,null);
  this.node=new LazyTailArrayNode(record,schema);
}

Fixed version (ground truth):
@Override public void initArrayNode(){
}
Program: 87649
Project: 87649
Buggy source:
@Test public void shouldReturnTheCorrectNode(){
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(0));
}

Fixed version (ground truth):
@Test public void shouldReturnTheCorrectNode(){
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(0));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(1));
}
Program: 87651
Project: 87651
Buggy source:
@Override public JsonNode evaluate(final JsonNode node,final EvaluationContext context){
  return LongNode.valueOf((((LongNode)((ArrayNode)node).get(0)).getLongValue() << 48) + ((LongNode)((ArrayNode)node).get(1)).getLongValue());
}

Fixed version (ground truth):
@Override public IJsonNode evaluate(IJsonNode node,IJsonNode target,EvaluationContext context){
  return LongNode.valueOf((((LongNode)((ArrayNode)node).get(0)).getLongValue() << 48) + ((LongNode)((ArrayNode)node).get(1)).getLongValue());
}
Program: 87652
Project: 87652
Buggy source:
@Override public IJsonNode evaluate(IJsonNode node,EvaluationContext context){
  throw new EvaluationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public IJsonNode evaluate(IJsonNode node,IJsonNode target,EvaluationContext context){
  throw new EvaluationException("String_Node_Str");
}
Program: 87653
Project: 87653
Buggy source:
public void collect(final IJsonNode value){
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",value));
  this.collector.collect(this.record=this.schema.jsonToRecord(value,null,this.record));
}

Fixed version (ground truth):
public void collect(final IJsonNode value){
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",value));
  this.collector.collect(this.record=this.schema.jsonToRecord(value,this.record,this.context));
}
Program: 87654
Project: 87654
Buggy source:
@Override public void coGroup(final Iterator<PactRecord> records1,final Iterator<PactRecord> records2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  this.cachedIterator1.setIterator(records1);
  this.cachedIterator2.setIterator(records2);
  Iterator<IJsonNode> values1=this.cachedIterator1;
  Iterator<IJsonNode> values2=this.cachedIterator2;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached1=new ArrayList<IJsonNode>(), cached2=new ArrayList<IJsonNode>();
    while (values1.hasNext())     cached1.add(values1.next());
    while (values2.hasNext())     cached2.add(values2.next());
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached1,cached2));
    values1=cached1.iterator();
    values2=cached2.iterator();
  }
  final ArrayNode array1=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values1),values1);
  final ArrayNode array2=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values2),values2);
  try {
    this.coGroup(array1,array2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array1,array2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void coGroup(final Iterator<PactRecord> records1,final Iterator<PactRecord> records2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  this.cachedIterator1.setIterator(records1);
  this.cachedIterator2.setIterator(records2);
  Iterator<IJsonNode> values1=this.cachedIterator1;
  Iterator<IJsonNode> values2=this.cachedIterator2;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached1=new ArrayList<IJsonNode>(), cached2=new ArrayList<IJsonNode>();
    while (values1.hasNext())     cached1.add(values1.next());
    while (values2.hasNext())     cached2.add(values2.next());
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached1,cached2));
    values1=cached1.iterator();
    values2=cached2.iterator();
  }
  final ArrayNode array1=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values1),values1);
  final ArrayNode array2=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values2),values2);
  try {
    this.coGroup(array1,array2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array1,array2,e));
    throw e;
  }
}
Program: 87655
Project: 87655
Buggy source:
@Override public void cross(final PactRecord record1,final PactRecord record2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.cross(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void cross(final PactRecord record1,final PactRecord record2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.cross(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}
Program: 87656
Project: 87656
Buggy source:
@Override public void map(final PactRecord record,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input=this.inputSchema.recordToJson(record,this.cachedInput);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input));
  try {
    this.map(input,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),this.cachedInput,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void map(final PactRecord record,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input=this.inputSchema.recordToJson(record,this.cachedInput);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input));
  try {
    this.map(input,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),this.cachedInput,e));
    throw e;
  }
}
Program: 87657
Project: 87657
Buggy source:
@Override public void match(final PactRecord record1,final PactRecord record2,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.match(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void match(final PactRecord record1,final PactRecord record2,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.match(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}
Program: 87658
Project: 87658
Buggy source:
@Override public void reduce(final Iterator<PactRecord> records,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  this.cachedIterator.setIterator(records);
  Iterator<IJsonNode> values=this.cachedIterator;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached=new ArrayList<IJsonNode>();
    while (this.cachedIterator.hasNext())     cached.add(this.cachedIterator.next());
    values=cached.iterator();
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached));
  }
  final ArrayNode array=JsonUtil.wrapWithNode(this.needsResettableIterator(values),values);
  try {
    this.reduce(array,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void reduce(final Iterator<PactRecord> records,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  this.cachedIterator.setIterator(records);
  Iterator<IJsonNode> values=this.cachedIterator;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached=new ArrayList<IJsonNode>();
    while (this.cachedIterator.hasNext())     cached.add(this.cachedIterator.next());
    values=cached.iterator();
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached));
  }
  final ArrayNode array=JsonUtil.wrapWithNode(this.needsResettableIterator(values),values);
  try {
    this.reduce(array,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array,e));
    throw e;
  }
}
Program: 87659
Project: 87659
Buggy source:
@Override public IJsonNode recordToJson(PactRecord record,IJsonNode target){
  if (this.getHeadSize() + 1 != record.getNumFields())   throw new IllegalStateException("String_Node_Str");
  if (target == null)   target=new ArrayNode();
}

Fixed version (ground truth):
@Override public IJsonNode recordToJson(PactRecord record,IJsonNode target){
  if (this.getHeadSize() + 1 != record.getNumFields())   throw new IllegalStateException("String_Node_Str");
  if (target == null)   target=new ArrayNode();
 else   ((IArrayNode)target).clear();
  for (int i=0; i < this.getHeadSize(); i++) {
    if (record.getField(i,JsonNodeWrapper.class) != null) {
      ((IArrayNode)target).add(SopremoUtil.unwrap(record.getField(i,JsonNodeWrapper.class)));
    }
  }
  ((IArrayNode)target).addAll((IArrayNode)SopremoUtil.unwrap(record.getField(this.getHeadSize(),JsonNodeWrapper.class)));
  return target;
}
Program: 87660
Project: 87660
Buggy source:
@Override public IJsonNode remove(int index){
}

Fixed version (ground truth):
@Override public IJsonNode remove(int index){
  if (index < 0 || index >= this.size())   return MissingNode.getInstance();
  if (index < this.schema.getHeadSize()) {
    IJsonNode oldNode=SopremoUtil.wrap(this.getOtherField().remove(0));
    IJsonNode buffer;
    for (int i=this.schema.getHeadSize() - 1; i >= index; i--) {
      buffer=this.record.getField(i,JsonNodeWrapper.class);
      if (buffer == null) {
        buffer=MissingNode.getInstance();
      }
      if (oldNode.isMissing())       this.record.setNull(i);
 else       this.record.setField(i,oldNode);
      oldNode=buffer;
    }
    return SopremoUtil.unwrap(oldNode);
  }
  return this.getOtherField().remove(index - this.schema.getHeadSize());
}
Program: 87661
Project: 87661
Buggy source:
@Override public PactRecord jsonToRecord(IJsonNode value,PactRecord target,EvaluationContext context){
}

Fixed version (ground truth):
@Override public PactRecord jsonToRecord(IJsonNode value,PactRecord target,EvaluationContext context){
  IObjectNode others;
  if (target == null) {
    target=new PactRecord(this.mappings.size() + 1);
    for (int i=0; i < this.mappings.size(); i++)     target.setField(i,new JsonNodeWrapper(MissingNode.getInstance()));
    target.setField(this.mappings.size(),new JsonNodeWrapper(others=new ObjectNode()));
  }
 else {
    JsonNodeWrapper wrappedField=target.getField(target.getNumFields() - 1,JsonNodeWrapper.class);
    others=wrappedField.getValue(IObjectNode.class);
    others.removeAll();
    target.setField(target.getNumFields() - 1,wrappedField);
  }
  IObjectNode object=(IObjectNode)value;
  for (int i=0; i < this.mappings.size(); i++) {
    IJsonNode node=object.get(this.mappings.get(i));
    JsonNodeWrapper wrappedField=target.getField(i,JsonNodeWrapper.class);
    wrappedField.setValue(node);
    target.setField(i,wrappedField);
  }
  for (  Entry<String,IJsonNode> entry : object.getEntries())   if (!this.mappings.contains(entry.getKey()))   others.put(entry.getKey(),entry.getValue());
  return target;
}
Program: 87664
Project: 87664
Buggy source:
private static void removeCheckpointMetaData(final Path pathPrefix) throws IOException {
  Path p=pathPrefix.suffix(COMPLETED_CHECKPOINT_SUFFIX);
  FileSystem fs=p.getFileSystem();
  if (fs.exists(p)) {
    fs.delete(p,false);
    return;
  }
  p=pathPrefix.suffix("String_Node_Str");
  if (fs.exists(p)) {
    fs.delete(p,false);
  }
  p=pathPrefix.suffix("String_Node_Str");
  if (fs.exists(p)) {
    fs.delete(p,false);
  }
}

Fixed version (ground truth):
private static boolean removeCheckpointMetaData(final Path pathPrefix) throws IOException {
  boolean removed=false;
  Path p=pathPrefix.suffix("String_Node_Str");
  FileSystem fs=p.getFileSystem();
  if (fs.exists(p)) {
    fs.delete(p,false);
    removed=true;
  }
  int suffix=0;
  while (true) {
    p=pathPrefix.suffix("String_Node_Str" + suffix++);
    if (fs.exists(p)) {
      fs.delete(p,false);
      removed=true;
    }
 else {
      break;
    }
  }
  p=pathPrefix.suffix(COMPLETED_CHECKPOINT_SUFFIX);
  if (fs.exists(p)) {
    fs.delete(p,false);
    removed=true;
  }
  return removed;
}
Program: 87665
Project: 87665
Buggy source:
/** 
 * Removes the checkpoint of the vertex with the given ID. All files contained in the checkpoint are deleted.
 * @param vertexID the vertex whose checkpoint shall be removed
 */
public static void removeCheckpoint(final ExecutionVertexID vertexID){
  final Path localChPath=getLocalCheckpointPath();
  try {
    removeCheckpointMetaData(new Path(localChPath + Path.SEPARATOR + METADATA_PREFIX));
    final Path distributedChPath=getDistributedCheckpointPath();
    if (distributedChPath != null) {
      removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX));
    }
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
/** 
 * Removes the checkpoint of the vertex with the given ID. All files contained in the checkpoint are deleted.
 * @param vertexID the vertex whose checkpoint shall be removed
 */
public static void removeCheckpoint(final ExecutionVertexID vertexID){
  final Path localChPath=getLocalCheckpointPath();
  try {
    if (!removeCheckpointMetaData(new Path(localChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID))) {
      final Path distributedChPath=getDistributedCheckpointPath();
      if (distributedChPath != null) {
        removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID));
      }
    }
    FileBufferManager.deleteFile(vertexID);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 87666
Project: 87666
Buggy source:
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  if (this.instanceManager != null) {
    this.instanceManager.shutdown();
  }
  DiscoveryService.stopDiscoveryService();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  if (this.jobManagerServer != null) {
    this.jobManagerServer.stop();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
  }
  final Iterator<JobManagerPlugin> it=this.jobManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  if (this.eventCollector != null) {
    this.eventCollector.shutdown();
  }
  if (this.scheduler != null) {
    this.scheduler.shutdown();
  }
  this.isShutDown=true;
  LOG.debug("String_Node_Str");
}

Fixed version (ground truth):
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  if (this.instanceManager != null) {
    this.instanceManager.shutdown();
  }
  DiscoveryService.stopDiscoveryService();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  if (this.jobManagerServer != null) {
    this.jobManagerServer.stop();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
    try {
      this.executorService.awaitTermination(5000L,TimeUnit.MILLISECONDS);
    }
 catch (    InterruptedException e) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(e));
      }
    }
  }
  final Iterator<JobManagerPlugin> it=this.jobManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  if (this.eventCollector != null) {
    this.eventCollector.shutdown();
  }
  if (this.scheduler != null) {
    this.scheduler.shutdown();
  }
  this.isShutDown=true;
  LOG.debug("String_Node_Str");
}
Program: 87667
Project: 87667
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public TaskCancelResult cancelTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskCancelResult taskCancelResult=new TaskCancelResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskCancelResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskCancelResult;
  }
  final Thread tmpThread=new Thread(new Runnable(){
    @Override public void run(){
      task.cancelExecution();
    }
  }
);
  tmpThread.start();
  return new TaskCancelResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public TaskCancelResult cancelTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskCancelResult taskCancelResult=new TaskCancelResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskCancelResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskCancelResult;
  }
  final Runnable r=new Runnable(){
    @Override public void run(){
      task.cancelExecution();
    }
  }
;
  this.executorService.execute(r);
  return new TaskCancelResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}
Program: 87668
Project: 87668
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void removeCheckpoints(final List<ExecutionVertexID> listOfVertexIDs) throws IOException {
  final Thread checkpointRemovalThread=new Thread("String_Node_Str"){
    @Override public void run(){
      final Iterator<ExecutionVertexID> it=listOfVertexIDs.iterator();
      while (it.hasNext()) {
        final ExecutionVertexID vertexID=it.next();
        EnvelopeConsumptionLog.removeLog(vertexID);
        CheckpointUtils.removeCheckpoint(vertexID);
      }
    }
  }
;
  checkpointRemovalThread.start();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void removeCheckpoints(final List<ExecutionVertexID> listOfVertexIDs) throws IOException {
  final List<ExecutionVertexID> threadSafeList=Collections.unmodifiableList(listOfVertexIDs);
  final Runnable r=new Runnable(){
    @Override public void run(){
      final Iterator<ExecutionVertexID> it=threadSafeList.iterator();
      while (it.hasNext()) {
        final ExecutionVertexID vertexID=it.next();
        EnvelopeConsumptionLog.removeLog(vertexID);
        CheckpointUtils.removeCheckpoint(vertexID);
      }
    }
  }
;
  this.executorService.execute(r);
}
Program: 87669
Project: 87669
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public TaskKillResult killTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskKillResult taskKillResult=new TaskKillResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskKillResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskKillResult;
  }
  final Thread tmpThread=new Thread(new Runnable(){
    @Override public void run(){
      task.killExecution();
    }
  }
);
  tmpThread.start();
  return new TaskKillResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public TaskKillResult killTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskKillResult taskKillResult=new TaskKillResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskKillResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskKillResult;
  }
  final Runnable r=new Runnable(){
    @Override public void run(){
      task.killExecution();
    }
  }
;
  this.executorService.execute(r);
  return new TaskKillResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}
Program: 87670
Project: 87670
Buggy source:
/** 
 * Shuts the task manager down.
 */
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  LOG.info("String_Node_Str");
  RPC.stopProxy(this.jobManager);
  this.taskManagerServer.stop();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  this.byteBufferedChannelManager.shutdown();
  if (this.ioManager != null) {
    this.ioManager.shutdown();
  }
  if (this.memoryManager != null) {
    this.memoryManager.shutdown();
  }
  final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  this.isShutDown=true;
}

Fixed version (ground truth):
/** 
 * Shuts the task manager down.
 */
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  LOG.info("String_Node_Str");
  RPC.stopProxy(this.jobManager);
  this.taskManagerServer.stop();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  this.byteBufferedChannelManager.shutdown();
  if (this.ioManager != null) {
    this.ioManager.shutdown();
  }
  if (this.memoryManager != null) {
    this.memoryManager.shutdown();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
    try {
      this.executorService.awaitTermination(5000L,TimeUnit.MILLISECONDS);
    }
 catch (    InterruptedException e) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(e));
      }
    }
  }
  final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  this.isShutDown=true;
}
Program: 87672
Project: 87672
Buggy source:
RuntimeInputChannelContext(final RuntimeInputGateContext inputGateContext,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final AbstractByteBufferedInputChannel<?> byteBufferedInputChannel,final EnvelopeConsumptionLog envelopeConsumptionLog){
  this.inputGateContext=inputGateContext;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.byteBufferedInputChannel=byteBufferedInputChannel;
  this.byteBufferedInputChannel.setInputChannelBroker(this);
  this.envelopeConsumptionLog=envelopeConsumptionLog;
}

Fixed version (ground truth):
RuntimeInputChannelContext(final RuntimeInputGateContext inputGateContext,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final AbstractByteBufferedInputChannel<?> byteBufferedInputChannel,final EnvelopeConsumptionLog envelopeConsumptionLog){
  this.inputGateContext=inputGateContext;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.byteBufferedInputChannel=byteBufferedInputChannel;
  this.byteBufferedInputChannel.setInputChannelBroker(this);
  this.envelopeConsumptionLog=envelopeConsumptionLog;
  this.isReexecuted=(envelopeConsumptionLog.getNumberOfInitialLogEntries() > 0L);
}
Program: 87677
Project: 87677
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void read(DataInput in) throws IOException {
  final int addr_length=in.readInt();
  byte[] address=new byte[addr_length];
  in.readFully(address);
  this.hostname=StringRecord.readString(in);
  this.domainname=StringRecord.readString(in);
  try {
    this.inetAddress=InetAddress.getByAddress(address);
  }
 catch (  UnknownHostException uhe) {
    throw new IOException(StringUtils.stringifyException(uhe));
  }
  this.ipcPort=in.readInt();
  this.dataPort=in.readInt();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void read(final DataInput in) throws IOException {
  final int addr_length=in.readInt();
  byte[] address=new byte[addr_length];
  in.readFully(address);
  this.hostName=StringRecord.readString(in);
  this.domainName=StringRecord.readString(in);
  try {
    this.inetAddress=InetAddress.getByAddress(address);
  }
 catch (  UnknownHostException uhe) {
    throw new IOException(StringUtils.stringifyException(uhe));
  }
  this.ipcPort=in.readInt();
  this.dataPort=in.readInt();
}
Program: 87678
Project: 87678
Buggy source:
/** 
 * Returns the host name of the instance. If the host name could not be determined, the return value will be a textual representation of the instance's IP address.
 * @return the host name of the instance
 */
public String getHostName(){
  return this.hostname;
}

Fixed version (ground truth):
/** 
 * Returns the host name of the instance. If the host name could not be determined, the return value will be a textual representation of the instance's IP address.
 * @return the host name of the instance
 */
public String getHostName(){
  return this.hostName;
}
Program: 87679
Project: 87679
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (obj instanceof InstanceConnectionInfo) {
    InstanceConnectionInfo ici=(InstanceConnectionInfo)obj;
    if (!this.inetAddress.equals(ici.getAddress())) {
      return false;
    }
    if (this.ipcPort != ici.getIPCPort()) {
      return false;
    }
    if (this.dataPort != ici.getDataPort()) {
      return false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(final Object obj){
  if (obj instanceof InstanceConnectionInfo) {
    InstanceConnectionInfo ici=(InstanceConnectionInfo)obj;
    if (!this.inetAddress.equals(ici.getAddress())) {
      return false;
    }
    if (this.ipcPort != ici.getIPCPort()) {
      return false;
    }
    if (this.dataPort != ici.getDataPort()) {
      return false;
    }
    return true;
  }
  return false;
}
Program: 87680
Project: 87680
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  String iaString;
  if (this.hostname != null) {
    iaString=this.hostname;
  }
 else {
    iaString=inetAddress.toString();
    iaString=iaString.replace("String_Node_Str","String_Node_Str");
  }
  return iaString;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  String iaString;
  if (this.hostName != null) {
    iaString=this.hostName;
  }
 else {
    iaString=inetAddress.toString();
    iaString=iaString.replace("String_Node_Str","String_Node_Str");
  }
  return iaString;
}
Program: 87681
Project: 87681
Buggy source:
@Override public int compareTo(InstanceConnectionInfo o){
  return this.getAddress().getHostName().compareTo(((InstanceConnectionInfo)o).getAddress().getHostName());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int compareTo(final InstanceConnectionInfo o){
  return this.getAddress().getHostName().compareTo(((InstanceConnectionInfo)o).getAddress().getHostName());
}
Program: 87682
Project: 87682
Buggy source:
/** 
 * Returns the domain name of the instance.
 * @return the domain name of the instance or <code>null</code> if the domain name could not be determined
 */
public String getDomainName(){
  return this.domainname;
}

Fixed version (ground truth):
/** 
 * Returns the domain name of the instance.
 * @return the domain name of the instance or <code>null</code> if the domain name could not be determined
 */
public String getDomainName(){
  return this.domainName;
}
Program: 87683
Project: 87683
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(this.inetAddress.getAddress().length);
  out.write(this.inetAddress.getAddress());
  StringRecord.writeString(out,this.hostname);
  StringRecord.writeString(out,this.domainname);
  out.writeInt(this.ipcPort);
  out.writeInt(this.dataPort);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  out.writeInt(this.inetAddress.getAddress().length);
  out.write(this.inetAddress.getAddress());
  StringRecord.writeString(out,this.hostName);
  StringRecord.writeString(out,this.domainName);
  out.writeInt(this.ipcPort);
  out.writeInt(this.dataPort);
}
Program: 87684
Project: 87684
Buggy source:
public ChannelReaderInputView(BlockChannelReader reader,List<MemorySegment> memory,int numBlocks,boolean waitForFirstBlock) throws IOException {
  super(ChannelWriterOutputView.HEADER_LENGTH);
  if (reader == null || memory == null)   throw new NullPointerException();
  if (memory.isEmpty())   throw new IllegalArgumentException("String_Node_Str");
  if (numBlocks < 1 && numBlocks != -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.reader=reader;
  this.numRequestsRemaining=numBlocks;
  this.numSegments=memory.size();
  for (int i=0; i < memory.size(); i++) {
    sendReadRequest(memory.get(i));
  }
  if (waitForFirstBlock) {
    advance();
  }
}

Fixed version (ground truth):
public ChannelReaderInputView(BlockChannelReader reader,List<MemorySegment> memory,int numBlocks,boolean waitForFirstBlock) throws IOException {
  super(ChannelWriterOutputView.HEADER_LENGTH);
  if (reader == null || memory == null)   throw new NullPointerException();
  if (memory.isEmpty())   throw new IllegalArgumentException("String_Node_Str");
  if (numBlocks < 1 && numBlocks != -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.reader=reader;
  this.numRequestsRemaining=numBlocks;
  this.numSegments=memory.size();
  this.freeMem=new ArrayList<MemorySegment>(this.numSegments);
  for (int i=0; i < memory.size(); i++) {
    sendReadRequest(memory.get(i));
  }
  if (waitForFirstBlock) {
    advance();
  }
}
Program: 87685
Project: 87685
Buggy source:
/** 
 * Sends a new read requests, if further requests remain. Otherwise, this method adds the segment directly to the readers return queue.
 * @param seg The segment to use for the read request.
 * @throws IOException Thrown, if the reader is in error.
 */
private void sendReadRequest(MemorySegment seg) throws IOException {
  if (this.numRequestsRemaining != 0) {
    this.reader.readBlock(seg);
    if (this.numRequestsRemaining != -1) {
      this.numRequestsRemaining--;
    }
  }
 else {
    this.reader.getReturnQueue().add(seg);
  }
}

Fixed version (ground truth):
/** 
 * Sends a new read requests, if further requests remain. Otherwise, this method adds the segment directly to the readers return queue.
 * @param seg The segment to use for the read request.
 * @throws IOException Thrown, if the reader is in error.
 */
private void sendReadRequest(MemorySegment seg) throws IOException {
  if (this.numRequestsRemaining != 0) {
    this.reader.readBlock(seg);
    if (this.numRequestsRemaining != -1) {
      this.numRequestsRemaining--;
    }
  }
 else {
    this.freeMem.add(seg);
  }
}
Program: 87686
Project: 87686
Buggy source:
/** 
 * Closes this InoutView, closing the underlying reader and returning all memory segments.
 * @return A list containing all memory segments originally supplied to this view.
 * @throws IOException Thrown, if the underlying reader could not be properly closed.
 */
public List<MemorySegment> close() throws IOException {
  if (this.closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.closed=true;
  ArrayList<MemorySegment> list=new ArrayList<MemorySegment>(this.numSegments);
  final MemorySegment current=getCurrentSegment();
  if (current != null) {
    list.add(current);
  }
  clear();
  final LinkedBlockingQueue<MemorySegment> queue=this.reader.getReturnQueue();
  this.reader.close();
  while (list.size() < this.numSegments) {
    final MemorySegment m=queue.poll();
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    list.add(m);
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Closes this InputView, closing the underlying reader and returning all memory segments.
 * @return A list containing all memory segments originally supplied to this view.
 * @throws IOException Thrown, if the underlying reader could not be properly closed.
 */
public List<MemorySegment> close() throws IOException {
  if (this.closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.closed=true;
  ArrayList<MemorySegment> list=this.freeMem;
  final MemorySegment current=getCurrentSegment();
  if (current != null) {
    list.add(current);
  }
  clear();
  final LinkedBlockingQueue<MemorySegment> queue=this.reader.getReturnQueue();
  this.reader.close();
  while (list.size() < this.numSegments) {
    final MemorySegment m=queue.poll();
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    list.add(m);
  }
  return list;
}
Program: 87687
Project: 87687
Buggy source:
/** 
 * Creates an new ChannelWriterOutputView that writes to the given channel. It uses only a single memory segment for the buffering, which it takes from the writers return queue.
 * @param writer The writer to write to.
 * @param segmentSize The size of the memory segments.
 */
public ChannelWriterOutputView(BlockChannelWriter writer,int segmentSize){
  this(writer,null,segmentSize);
}

Fixed version (ground truth):
/** 
 * Creates an new ChannelWriterOutputView that writes to the given channel. It uses only a single memory segment for the buffering, which it takes from the writers return queue. Note that this variant locks if no buffers are contained in the return queue.
 * @param writer The writer to write to.
 * @param segmentSize The size of the memory segments.
 */
public ChannelWriterOutputView(BlockChannelWriter writer,int segmentSize){
  this(writer,null,segmentSize);
}
Program: 87688
Project: 87688
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    LOG.info("String_Node_Str");
  }
 else   if (event instanceof UnexpectedEnvelopeEvent) {
    final UnexpectedEnvelopeEvent uee=(UnexpectedEnvelopeEvent)event;
    if (uee.getExpectedSequenceNumber() > this.nextEnvelopeToSend) {
      this.nextEnvelopeToSend=uee.getExpectedSequenceNumber();
    }
  }
 else   if (event instanceof ReceiverNotFoundEvent) {
    final ReceiverNotFoundEvent rnfe=(ReceiverNotFoundEvent)event;
    LOG.warn("String_Node_Str" + rnfe.getReceiverID() + "String_Node_Str"+ rnfe.getSequenceNumber());
  }
 else {
    LOG.warn("String_Node_Str" + event);
  }
  getNext().processEvent(event);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    LOG.info("String_Node_Str");
  }
 else   if (event instanceof UnexpectedEnvelopeEvent) {
    final UnexpectedEnvelopeEvent uee=(UnexpectedEnvelopeEvent)event;
    if (uee.getExpectedSequenceNumber() > this.nextEnvelopeToSend) {
      this.nextEnvelopeToSend=uee.getExpectedSequenceNumber();
    }
  }
 else   if (event instanceof ReceiverNotFoundEvent) {
    final ReceiverNotFoundEvent rnfe=(ReceiverNotFoundEvent)event;
    LOG.warn("String_Node_Str" + rnfe.getReceiverID() + "String_Node_Str"+ rnfe.getSequenceNumber()+ "String_Node_Str"+ this.nextEnvelopeToSend);
  }
 else {
    LOG.warn("String_Node_Str" + event);
  }
  getNext().processEvent(event);
}
Program: 87690
Project: 87690
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  changeExecutionState(ExecutionState.REPLAYING,null);
  if (this.executionObserver.isCanceled()) {
    changeExecutionState(ExecutionState.CANCELED,null);
    return;
  }
  resetAllOutputBroker();
  try {
    replayCheckpoint();
    if (this.executionObserver.isCanceled()) {
      throw new InterruptedException();
    }
  }
 catch (  Exception e) {
    if (this.executionObserver.isCanceled()) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHING,null);
  try {
    waitForAllOutputBrokerToFinish();
  }
 catch (  Exception e) {
    if (this.executionObserver.isCanceled()) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHED,null);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  changeExecutionState(ExecutionState.REPLAYING,null);
  if (this.executionObserver.isCanceled()) {
    changeExecutionState(ExecutionState.CANCELED,null);
    return;
  }
  try {
    replayCheckpoint();
    if (this.executionObserver.isCanceled()) {
      throw new InterruptedException();
    }
  }
 catch (  Exception e) {
    if (this.executionObserver.isCanceled()) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHING,null);
  try {
    waitForAllOutputBrokerToFinish();
  }
 catch (  Exception e) {
    if (this.executionObserver.isCanceled()) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHED,null);
}
Program: 87691
Project: 87691
Buggy source:
/** 
 * Checks, if all target vertices for multicast transmisison are ready. If vertices are in state ASSIGNED, it will deploy those vertices.
 * @param caller
 * @param jobID
 * @param sourceChannelID
 * @return
 */
private boolean checkIfAllTargetVerticesReady(InstanceConnectionInfo caller,JobID jobID,ChannelID sourceChannelID){
  final ExecutionGraph eg=this.scheduler.getExecutionGraphByID(jobID);
  final AbstractOutputChannel<? extends Record> outputChannel=eg.getOutputChannelByID(sourceChannelID);
  final OutputGate<? extends Record> broadcastgate=outputChannel.getOutputGate();
  List<ExecutionVertex> verticesToDeploy=null;
  for (  AbstractOutputChannel<? extends Record> c : broadcastgate.getOutputChannels()) {
    if (c.isBroadcastChannel()) {
      ExecutionVertex targetVertex=eg.getVertexByChannelID(c.getConnectedChannelID());
      if (targetVertex.getExecutionState() == ExecutionState.ASSIGNED) {
        if (verticesToDeploy == null) {
          verticesToDeploy=new ArrayList<ExecutionVertex>();
        }
        verticesToDeploy.add(targetVertex);
      }
 else {
        if (targetVertex.getExecutionState() != ExecutionState.RUNNING && targetVertex.getExecutionState() != ExecutionState.FINISHING && targetVertex.getExecutionState() != ExecutionState.READY && targetVertex.getExecutionState() != ExecutionState.STARTING) {
          return false;
        }
      }
    }
  }
  if (verticesToDeploy != null) {
    this.scheduler.deployAssignedVertices(verticesToDeploy);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks, if all target vertices for multicast transmisison are ready. If vertices are in state ASSIGNED, it will deploy those vertices.
 * @param caller
 * @param jobID
 * @param sourceChannelID
 * @return
 */
private boolean checkIfAllTargetVerticesReady(InstanceConnectionInfo caller,JobID jobID,ChannelID sourceChannelID){
  final ExecutionGraph eg=this.scheduler.getExecutionGraphByID(jobID);
  final AbstractOutputChannel<? extends Record> outputChannel=eg.getOutputChannelByID(sourceChannelID);
  final OutputGate<? extends Record> broadcastgate=outputChannel.getOutputGate();
  List<ExecutionVertex> verticesToDeploy=null;
  for (  AbstractOutputChannel<? extends Record> c : broadcastgate.getOutputChannels()) {
    if (c.isBroadcastChannel()) {
      ExecutionVertex targetVertex=eg.getVertexByChannelID(c.getConnectedChannelID());
      if (targetVertex.getExecutionState() == ExecutionState.ASSIGNED) {
        if (verticesToDeploy == null) {
          verticesToDeploy=new ArrayList<ExecutionVertex>();
        }
        verticesToDeploy.add(targetVertex);
      }
 else {
        if (targetVertex.getExecutionState() != ExecutionState.RUNNING && targetVertex.getExecutionState() != ExecutionState.FINISHING) {
          return false;
        }
      }
    }
  }
  if (verticesToDeploy != null) {
    this.scheduler.deployAssignedVertices(verticesToDeploy);
    return false;
  }
  return true;
}