nus-yam/ex-repair huggingface dataset:
Program: 55695
Project: 55695
Buggy source:
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),2,1);
  JsonStream input=sopremoModule.getInput(0);
  JsonStream nullInput=sopremoModule.getInput(1);
  int n=3;
  Partitioning partitioning=new Partitioning().withInputs(input);
  Grouping group=new Grouping().withInputs(partitioning).withGroupingKey(EvaluationExpression.KEY).withResetKey(false);
  final GenerateMatrix genMatrix=new GenerateMatrix().withInputs(group);
  final GenerateEmptyMatrix emptyMatrix=new GenerateEmptyMatrix().withInputs(nullInput);
  emptyMatrix.setN(n);
  final FillMatrix filledMatrix=new FillMatrix().withInputs(genMatrix,emptyMatrix);
  final Phase1 phase1=new Phase1().withInputs(filledMatrix);
  final Phase2 phase2=new Phase2().withInputs(phase1,genMatrix);
  final Phase3 phase3=new Phase3().withInputs(new UnionAll().withInputs(phase1,phase2));
  final EmitMatrix result=new EmitMatrix().withInputs(new UnionAll().withInputs(phase1,phase2));
  sopremoModule.getOutput(0).setInput(0,result);
  return sopremoModule;
}

Fixed version (ground truth):
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),2,1);
  JsonStream input=sopremoModule.getInput(0);
  JsonStream nullInput=sopremoModule.getInput(1);
  int n=3;
  Partitioning partitioning=new Partitioning().withInputs(input);
  Grouping group=new Grouping().withInputs(partitioning).withGroupingKey(EvaluationExpression.KEY).withResetKey(false);
  final GenerateMatrix genMatrix=new GenerateMatrix().withInputs(group);
  final GenerateEmptyMatrix emptyMatrix=new GenerateEmptyMatrix().withInputs(nullInput);
  emptyMatrix.setN(n);
  final FillMatrix filledMatrix=new FillMatrix().withInputs(genMatrix,emptyMatrix);
  final Phase1 phase1=new Phase1().withInputs(filledMatrix);
  final Phase2 phase2=new Phase2().withInputs(phase1,filledMatrix);
  final Phase3 phase3=new Phase3().withInputs(new UnionAll().withInputs(phase1,phase2));
  final EmitMatrix result=new EmitMatrix().withInputs(phase3);
  sopremoModule.getOutput(0).setInput(0,result);
  return sopremoModule;
}
Program: 55696
Project: 55696
Buggy source:
/** 
 * Creates the record readers for the number of inputs as defined by   {@link #getNumberOfInputs()}.
 */
protected void initInputs(){
  int numInputs=getNumberOfInputs();
  @SuppressWarnings("String_Node_Str") final MutableObjectIterator<PactRecord>[] inputs=new MutableObjectIterator[numInputs];
  for (int i=0; i < numInputs; i++) {
    final ShipStrategy shipStrategy=this.config.getInputShipStrategy(i);
    DistributionPattern dp=null;
switch (shipStrategy) {
case FORWARD:
case PARTITION_LOCAL_HASH:
case PARTITION_LOCAL_RANGE:
      dp=new PointwiseDistributionPattern();
    break;
case PARTITION_HASH:
case PARTITION_RANGE:
case BROADCAST:
case SFR:
  dp=new BipartiteDistributionPattern();
break;
default :
throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ shipStrategy.name());
}
final int groupSize=this.config.getGroupSize(i + 1);
if (groupSize == 1) {
inputs[i]=new NepheleReaderIterator(new MutableRecordReader<PactRecord>(this,dp));
}
 else {
@SuppressWarnings("String_Node_Str") MutableRecordReader<PactRecord>[] readers=new MutableRecordReader[groupSize];
for (int j=0; j < groupSize; ++j) {
readers[j]=new MutableRecordReader<PactRecord>(this,dp);
}
inputs[i]=new NepheleReaderIterator(new MutableUnionRecordReader<PactRecord>(readers));
}
}
this.inputs=inputs;
}

Fixed version (ground truth):
/** 
 * Creates the record readers for the number of inputs as defined by   {@link #getNumberOfInputs()}.
 */
protected void initInputs(){
  int numInputs=getNumberOfInputs();
  @SuppressWarnings("String_Node_Str") final MutableObjectIterator<PactRecord>[] inputs=new MutableObjectIterator[numInputs];
  for (int i=0; i < numInputs; i++) {
    final ShipStrategy shipStrategy=this.config.getInputShipStrategy(i);
    DistributionPattern dp=null;
switch (shipStrategy) {
case FORWARD:
case PARTITION_LOCAL_HASH:
case PARTITION_LOCAL_RANGE:
      dp=new PointwiseDistributionPattern();
    break;
case PARTITION_HASH:
case PARTITION_RANGE:
case BROADCAST:
case SFR:
  dp=new BipartiteDistributionPattern();
break;
default :
throw new RuntimeException("String_Node_Str" + i + "String_Node_Str"+ shipStrategy.name());
}
final int groupSize=this.config.getGroupSize(i + 1);
if (groupSize < 2) {
inputs[i]=new NepheleReaderIterator(new MutableRecordReader<PactRecord>(this,dp));
}
 else {
@SuppressWarnings("String_Node_Str") MutableRecordReader<PactRecord>[] readers=new MutableRecordReader[groupSize];
for (int j=0; j < groupSize; ++j) {
readers[j]=new MutableRecordReader<PactRecord>(this,dp);
}
inputs[i]=new NepheleReaderIterator(new MutableUnionRecordReader<PactRecord>(readers));
}
}
this.inputs=inputs;
}
Program: 55697
Project: 55697
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void transferEvent(AbstractEvent event) throws IOException, InterruptedException {
  this.outputChannelBroker.transferEventToInputChannel(event);
  flush();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void transferEvent(AbstractEvent event) throws IOException, InterruptedException {
  flush();
  this.outputChannelBroker.transferEventToInputChannel(event);
}
Program: 55698
Project: 55698
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void requestClose() throws IOException, InterruptedException {
  if (!this.closeRequested) {
    this.closeRequested=true;
    flush();
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void requestClose() throws IOException, InterruptedException {
  if (!this.closeRequested) {
    this.closeRequested=true;
    transferEvent(new ByteBufferedChannelCloseEvent());
    flush();
  }
}
Program: 55700
Project: 55700
Buggy source:
@Override public void releaseConsumedReadBuffer(){
  TransferEnvelope transferEnvelope=null;
synchronized (this.queuedEnvelopes) {
    if (this.queuedEnvelopes.isEmpty()) {
      LOG.error("String_Node_Str");
      return;
    }
    transferEnvelope=this.queuedEnvelopes.poll();
    if (transferEnvelope.getBuffer() != null) {
      if (transferEnvelope.getBuffer().isBackedByMemory()) {
        --this.numberOfMemoryBuffers;
      }
 else {
        --this.numberOfFileBuffers;
      }
    }
  }
  final Buffer consumedBuffer=transferEnvelope.getBuffer();
  if (consumedBuffer == null) {
    LOG.error("String_Node_Str");
    return;
  }
  if (consumedBuffer.remaining() > 0) {
    LOG.error("String_Node_Str" + consumedBuffer.remaining() + "String_Node_Str");
  }
  consumedBuffer.recycleBuffer();
  if (this.uncompressedDataBuffer != null) {
    this.uncompressedDataBuffer.recycleBuffer();
    this.uncompressedDataBuffer=null;
  }
}

Fixed version (ground truth):
@Override public void releaseConsumedReadBuffer(){
  TransferEnvelope transferEnvelope=null;
synchronized (this.queuedEnvelopes) {
    if (this.queuedEnvelopes.isEmpty()) {
      LOG.error("String_Node_Str");
      return;
    }
    transferEnvelope=this.queuedEnvelopes.poll();
    if (transferEnvelope.getBuffer() != null) {
      if (transferEnvelope.getBuffer().isBackedByMemory()) {
        --this.numberOfMemoryBuffers;
      }
 else {
        --this.numberOfFileBuffers;
      }
    }
  }
  final EventList eventList=transferEnvelope.getEventList();
  if (!eventList.isEmpty()) {
    final Iterator<AbstractEvent> it=eventList.iterator();
    while (it.hasNext()) {
      this.byteBufferedInputChannel.processEvent(it.next());
    }
  }
  final Buffer consumedBuffer=transferEnvelope.getBuffer();
  if (consumedBuffer == null) {
    LOG.error("String_Node_Str");
    return;
  }
  if (consumedBuffer.remaining() > 0) {
    LOG.error("String_Node_Str" + consumedBuffer.remaining() + "String_Node_Str");
  }
  consumedBuffer.recycleBuffer();
  if (this.uncompressedDataBuffer != null) {
    this.uncompressedDataBuffer.recycleBuffer();
    this.uncompressedDataBuffer=null;
  }
}
Program: 55701
Project: 55701
Buggy source:
/** 
 * Registers a new job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be registered
 */
public void registerJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplit[] inputSplits=groupVertex.getInputSplits();
    if (inputSplits == null) {
      continue;
    }
    if (inputSplits.length == 0) {
      continue;
    }
    final AbstractInvokable invokable=groupVertex.getGroupMember(0).getEnvironment().getInvokable();
    if (!(invokable instanceof AbstractInputTask)) {
      LOG.error(groupVertex.getName() + "String_Node_Str" + inputSplits.length+ "String_Node_Str");
      continue;
    }
    @SuppressWarnings("String_Node_Str") final AbstractInputTask<? extends InputSplit> inputTask=(AbstractInputTask<? extends InputSplit>)invokable;
    final Class<? extends InputSplit> splitType=inputTask.getInputSplitType();
    final InputSplitAssigner assigner=getAssignerByType(splitType,true,executionGraph.getJobID());
    this.assignerCache.put(groupVertex,assigner);
    assigner.registerGroupVertex(groupVertex);
  }
}

Fixed version (ground truth):
/** 
 * Registers a new job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be registered
 */
public void registerJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplit[] inputSplits=groupVertex.getInputSplits();
    if (inputSplits == null) {
      continue;
    }
    if (inputSplits.length == 0) {
      continue;
    }
    final AbstractInvokable invokable=groupVertex.getGroupMember(0).getEnvironment().getInvokable();
    if (!(invokable instanceof AbstractInputTask)) {
      LOG.error(groupVertex.getName() + "String_Node_Str" + inputSplits.length+ "String_Node_Str");
      continue;
    }
    @SuppressWarnings("String_Node_Str") final AbstractInputTask<? extends InputSplit> inputTask=(AbstractInputTask<? extends InputSplit>)invokable;
    final Class<? extends InputSplit> splitType=inputTask.getInputSplitType();
    final InputSplitAssigner assigner=getAssignerByType(splitType,true);
    this.assignerCache.put(groupVertex,assigner);
    assigner.registerGroupVertex(groupVertex);
  }
}
Program: 55702
Project: 55702
Buggy source:
/** 
 * Attempts to find the responsible type of   {@link InputSplitAssigner} for the given type of input split from theconfiguration and instantiate an object for it.
 * @param inputSplitType the type of input split to load the  {@link InputSplitAssigner} for
 * @return the newly loaded {@link InputSplitAssigner} object or <code>null</code> if no such object could belocated or loaded
 */
@SuppressWarnings("String_Node_Str") private InputSplitAssigner loadInputSplitAssigner(final Class<? extends InputSplit> inputSplitType,JobID jid){
  final String typeClassName=inputSplitType.getSimpleName();
  final String assignerKey=INPUT_SPLIT_CONFIG_KEY_PREFIX + typeClassName;
  LOG.info("String_Node_Str" + typeClassName);
  String assignerClassName=GlobalConfiguration.getString(assignerKey,null);
  if (assignerClassName == null) {
    if (FileInputSplit.class.getSimpleName().equals(typeClassName)) {
      assignerClassName=FileInputSplitAssigner.class.getName();
    }
 else {
      return null;
    }
  }
  try {
    Class<? extends InputSplitAssigner> assignerClass;
    boolean useUserJar=GlobalConfiguration.getBoolean(INPUT_SPLIT_CONFIG_KEY_PREFIX + "String_Node_Str",false);
    if (useUserJar) {
      final ClassLoader cl=LibraryCacheManager.getClassLoader(jid);
      assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName,true,cl);
    }
 else {
      assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName);
    }
    return assignerClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Attempts to find the responsible type of   {@link InputSplitAssigner} for the given type of input split from theconfiguration and instantiate an object for it.
 * @param inputSplitType the type of input split to load the  {@link InputSplitAssigner} for
 * @return the newly loaded {@link InputSplitAssigner} object or <code>null</code> if no such object could belocated or loaded
 */
private InputSplitAssigner loadInputSplitAssigner(final Class<? extends InputSplit> inputSplitType){
  final String typeClassName=inputSplitType.getSimpleName();
  final String assignerKey=INPUT_SPLIT_CONFIG_KEY_PREFIX + typeClassName;
  LOG.info("String_Node_Str" + typeClassName);
  String assignerClassName=GlobalConfiguration.getString(assignerKey,null);
  if (assignerClassName == null) {
    if (FileInputSplit.class.getSimpleName().equals(typeClassName)) {
      assignerClassName=FileInputSplitAssigner.class.getName();
    }
 else {
      return null;
    }
  }
  try {
    @SuppressWarnings("String_Node_Str") final Class<? extends InputSplitAssigner> assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName);
    return assignerClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
  return null;
}
Program: 55703
Project: 55703
Buggy source:
/** 
 * Returns the   {@link InputSplitAssigner} which is defined for the given type of input split.
 * @param inputSplitType the type of input split to find the corresponding  {@link InputSplitAssigner} for
 * @param allowLoading <code>true</code> to indicate that the input split assigner is allowed to load additional classes if necessary, <code>false</code> otherwise
 * @return the {@link InputSplitAssigner} responsible for the given type of input split
 */
private InputSplitAssigner getAssignerByType(final Class<? extends InputSplit> inputSplitType,final boolean allowLoading,JobID jid){
synchronized (this.loadedAssigners) {
    InputSplitAssigner assigner=this.loadedAssigners.get(inputSplitType);
    if (assigner == null && allowLoading) {
      assigner=loadInputSplitAssigner(inputSplitType,jid);
      if (assigner != null) {
        this.loadedAssigners.put(inputSplitType,assigner);
      }
    }
    if (assigner != null) {
      return assigner;
    }
  }
  LOG.warn("String_Node_Str" + inputSplitType.getName() + "String_Node_Str");
  return this.defaultAssigner;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link InputSplitAssigner} which is defined for the given type of input split.
 * @param inputSplitType the type of input split to find the corresponding  {@link InputSplitAssigner} for
 * @param allowLoading <code>true</code> to indicate that the input split assigner is allowed to load additional classes if necessary, <code>false</code> otherwise
 * @return the {@link InputSplitAssigner} responsible for the given type of input split
 */
private InputSplitAssigner getAssignerByType(final Class<? extends InputSplit> inputSplitType,final boolean allowLoading){
synchronized (this.loadedAssigners) {
    InputSplitAssigner assigner=this.loadedAssigners.get(inputSplitType);
    if (assigner == null && allowLoading) {
      assigner=loadInputSplitAssigner(inputSplitType);
      if (assigner != null) {
        this.loadedAssigners.put(inputSplitType,assigner);
      }
    }
    if (assigner != null) {
      return assigner;
    }
  }
  LOG.warn("String_Node_Str" + inputSplitType.getName() + "String_Node_Str");
  return this.defaultAssigner;
}
Program: 55704
Project: 55704
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void accept(Visitor<Contract> visitor){
  boolean descend=visitor.preVisit(this);
  if (descend) {
    for (    Contract c : this.input1) {
      c.accept(visitor);
    }
    for (    Contract c : this.input2) {
      c.accept(visitor);
    }
    visitor.postVisit(this);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void accept(Visitor<Contract> visitor){
  boolean descend=visitor.preVisit(this);
  if (descend) {
    if (visitor.preVisit(this)) {
      for (      Contract c : this.input1) {
        c.accept(visitor);
      }
      for (      Contract c : this.input2) {
        c.accept(visitor);
      }
    }
    visitor.postVisit(this);
  }
}
Program: 55705
Project: 55705
Buggy source:
/** 
 * Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given offset.
 * @param blocks The different blocks of the file. Must be ordered by their offset.
 * @param offset The offset of the position in the file.
 * @param startIndex The earliest index to look at.
 * @return The index of the block containing the given position.
 */
protected final int getBlockIndexForPosition(BlockLocation[] blocks,long offset,long halfSplitSize,int startIndex){
  for (int i=startIndex; i < blocks.length; i++) {
    long blockStart=blocks[i].getOffset();
    long blockEnd=blockStart + blocks[i].getLength();
    if (offset >= blockStart && offset < blockEnd) {
      if (i < blocks.length - 1 && blockEnd - offset < halfSplitSize) {
        return i + 1;
      }
 else {
        return i;
      }
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given offset.
 * @param blocks The different blocks of the file. Must be ordered by their offset.
 * @param offset The offset of the position in the file.
 * @param startIndex The earliest index to look at.
 * @return The index of the block containing the given position.
 */
private final int getBlockIndexForPosition(BlockLocation[] blocks,long offset,long halfSplitSize,int startIndex){
  for (int i=startIndex; i < blocks.length; i++) {
    long blockStart=blocks[i].getOffset();
    long blockEnd=blockStart + blocks[i].getLength();
    if (offset >= blockStart && offset < blockEnd) {
      if (i < blocks.length - 1 && blockEnd - offset < halfSplitSize) {
        return i + 1;
      }
 else {
        return i;
      }
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 55706
Project: 55706
Buggy source:
/** 
 * Opens an input stream to the file defined in the input format. The stream is positioned at the beginning of the given split. <p> The stream is actually opened in an asynchronous thread to make sure any interruptions to the thread  working on the input format do not reach the file system.
 * @see eu.stratosphere.pact.common.io.InputFormat#open(eu.stratosphere.nephele.template.InputSplit)
 */
@Override public void open(FileInputSplit split) throws IOException {
  if (!(split instanceof FileInputSplit)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final FileInputSplit fileSplit=(FileInputSplit)split;
  fileNumber=Integer.parseInt(split.getPath().getName());
  this.start=fileSplit.getStart();
  this.length=fileSplit.getLength();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str");
  final InputSplitOpenThread isot=new InputSplitOpenThread(fileSplit,OPEN_TIMEOUT_MILLIES);
  isot.start();
  try {
    isot.waitForCompletion();
  }
 catch (  Throwable t) {
    throw new IOException("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str"+ t.getMessage(),t);
  }
  this.stream=isot.getFSDataInputStream();
  this.stream.seek(this.start);
}

Fixed version (ground truth):
/** 
 * Opens an input stream to the file defined in the input format. The stream is positioned at the beginning of the given split. <p> The stream is actually opened in an asynchronous thread to make sure any interruptions to the thread  working on the input format do not reach the file system.
 * @see eu.stratosphere.pact.common.io.InputFormat#open(eu.stratosphere.nephele.template.InputSplit)
 */
@Override public void open(FileInputSplit split) throws IOException {
  if (!(split instanceof FileInputSplit)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final FileInputSplit fileSplit=(FileInputSplit)split;
  this.start=fileSplit.getStart();
  this.length=fileSplit.getLength();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str");
  final InputSplitOpenThread isot=new InputSplitOpenThread(fileSplit,OPEN_TIMEOUT_MILLIES);
  isot.start();
  try {
    isot.waitForCompletion();
  }
 catch (  Throwable t) {
    throw new IOException("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str"+ t.getMessage(),t);
  }
  this.stream=isot.getFSDataInputStream();
  this.stream.seek(this.start);
}
Program: 55707
Project: 55707
Buggy source:
/** 
 * Registers a new job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be registered
 */
public void registerJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplit[] inputSplits=groupVertex.getInputSplits();
    if (inputSplits == null) {
      continue;
    }
    if (inputSplits.length == 0) {
      continue;
    }
    final AbstractInvokable invokable=groupVertex.getGroupMember(0).getEnvironment().getInvokable();
    if (!(invokable instanceof AbstractInputTask)) {
      LOG.error(groupVertex.getName() + "String_Node_Str" + inputSplits.length+ "String_Node_Str");
      continue;
    }
    @SuppressWarnings("String_Node_Str") final AbstractInputTask<? extends InputSplit> inputTask=(AbstractInputTask<? extends InputSplit>)invokable;
    final Class<? extends InputSplit> splitType=inputTask.getInputSplitType();
    final InputSplitAssigner assigner=getAssignerByType(splitType,true);
    this.assignerCache.put(groupVertex,assigner);
    assigner.registerGroupVertex(groupVertex);
  }
}

Fixed version (ground truth):
/** 
 * Registers a new job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be registered
 */
public void registerJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplit[] inputSplits=groupVertex.getInputSplits();
    if (inputSplits == null) {
      continue;
    }
    if (inputSplits.length == 0) {
      continue;
    }
    final AbstractInvokable invokable=groupVertex.getGroupMember(0).getEnvironment().getInvokable();
    if (!(invokable instanceof AbstractInputTask)) {
      LOG.error(groupVertex.getName() + "String_Node_Str" + inputSplits.length+ "String_Node_Str");
      continue;
    }
    @SuppressWarnings("String_Node_Str") final AbstractInputTask<? extends InputSplit> inputTask=(AbstractInputTask<? extends InputSplit>)invokable;
    final Class<? extends InputSplit> splitType=inputTask.getInputSplitType();
    final InputSplitAssigner assigner=getAssignerByType(splitType,true,executionGraph.getJobID());
    this.assignerCache.put(groupVertex,assigner);
    assigner.registerGroupVertex(groupVertex);
  }
}
Program: 55708
Project: 55708
Buggy source:
/** 
 * Attempts to find the responsible type of   {@link InputSplitAssigner} for the given type of input split from theconfiguration and instantiate an object for it.
 * @param inputSplitType the type of input split to load the  {@link InputSplitAssigner} for
 * @return the newly loaded {@link InputSplitAssigner} object or <code>null</code> if no such object could belocated or loaded
 */
private InputSplitAssigner loadInputSplitAssigner(final Class<? extends InputSplit> inputSplitType){
  final String typeClassName=inputSplitType.getSimpleName();
  final String assignerKey=INPUT_SPLIT_CONFIG_KEY_PREFIX + typeClassName;
  LOG.info("String_Node_Str" + typeClassName);
  String assignerClassName=GlobalConfiguration.getString(assignerKey,null);
  if (assignerClassName == null) {
    if (FileInputSplit.class.getSimpleName().equals(typeClassName)) {
      assignerClassName=FileInputSplitAssigner.class.getName();
    }
 else {
      return null;
    }
  }
  try {
    @SuppressWarnings("String_Node_Str") final Class<? extends InputSplitAssigner> assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName);
    return assignerClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Attempts to find the responsible type of   {@link InputSplitAssigner} for the given type of input split from theconfiguration and instantiate an object for it.
 * @param inputSplitType the type of input split to load the  {@link InputSplitAssigner} for
 * @return the newly loaded {@link InputSplitAssigner} object or <code>null</code> if no such object could belocated or loaded
 */
@SuppressWarnings("String_Node_Str") private InputSplitAssigner loadInputSplitAssigner(final Class<? extends InputSplit> inputSplitType,JobID jid){
  final String typeClassName=inputSplitType.getSimpleName();
  final String assignerKey=INPUT_SPLIT_CONFIG_KEY_PREFIX + typeClassName;
  LOG.info("String_Node_Str" + typeClassName);
  String assignerClassName=GlobalConfiguration.getString(assignerKey,null);
  if (assignerClassName == null) {
    if (FileInputSplit.class.getSimpleName().equals(typeClassName)) {
      assignerClassName=FileInputSplitAssigner.class.getName();
    }
 else {
      return null;
    }
  }
  try {
    Class<? extends InputSplitAssigner> assignerClass;
    boolean useUserJar=GlobalConfiguration.getBoolean(INPUT_SPLIT_CONFIG_KEY_PREFIX + "String_Node_Str",false);
    if (useUserJar) {
      final ClassLoader cl=LibraryCacheManager.getClassLoader(jid);
      assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName,true,cl);
    }
 else {
      assignerClass=(Class<? extends InputSplitAssigner>)Class.forName(assignerClassName);
    }
    return assignerClass.newInstance();
  }
 catch (  Exception e) {
    LOG.error(StringUtils.stringifyException(e));
  }
  return null;
}
Program: 55709
Project: 55709
Buggy source:
/** 
 * Returns the   {@link InputSplitAssigner} which is defined for the given type of input split.
 * @param inputSplitType the type of input split to find the corresponding  {@link InputSplitAssigner} for
 * @param allowLoading <code>true</code> to indicate that the input split assigner is allowed to load additional classes if necessary, <code>false</code> otherwise
 * @return the {@link InputSplitAssigner} responsible for the given type of input split
 */
private InputSplitAssigner getAssignerByType(final Class<? extends InputSplit> inputSplitType,final boolean allowLoading){
synchronized (this.loadedAssigners) {
    InputSplitAssigner assigner=this.loadedAssigners.get(inputSplitType);
    if (assigner == null && allowLoading) {
      assigner=loadInputSplitAssigner(inputSplitType);
      if (assigner != null) {
        this.loadedAssigners.put(inputSplitType,assigner);
      }
    }
    if (assigner != null) {
      return assigner;
    }
  }
  LOG.warn("String_Node_Str" + inputSplitType.getName() + "String_Node_Str");
  return this.defaultAssigner;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link InputSplitAssigner} which is defined for the given type of input split.
 * @param inputSplitType the type of input split to find the corresponding  {@link InputSplitAssigner} for
 * @param allowLoading <code>true</code> to indicate that the input split assigner is allowed to load additional classes if necessary, <code>false</code> otherwise
 * @return the {@link InputSplitAssigner} responsible for the given type of input split
 */
private InputSplitAssigner getAssignerByType(final Class<? extends InputSplit> inputSplitType,final boolean allowLoading,JobID jid){
synchronized (this.loadedAssigners) {
    InputSplitAssigner assigner=this.loadedAssigners.get(inputSplitType);
    if (assigner == null && allowLoading) {
      assigner=loadInputSplitAssigner(inputSplitType,jid);
      if (assigner != null) {
        this.loadedAssigners.put(inputSplitType,assigner);
      }
    }
    if (assigner != null) {
      return assigner;
    }
  }
  LOG.warn("String_Node_Str" + inputSplitType.getName() + "String_Node_Str");
  return this.defaultAssigner;
}
Program: 55710
Project: 55710
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void accept(Visitor<Contract> visitor){
  boolean descend=visitor.preVisit(this);
  if (descend) {
    if (visitor.preVisit(this)) {
      for (      Contract c : this.input1) {
        c.accept(visitor);
      }
      for (      Contract c : this.input2) {
        c.accept(visitor);
      }
    }
    visitor.postVisit(this);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void accept(Visitor<Contract> visitor){
  boolean descend=visitor.preVisit(this);
  if (descend) {
    for (    Contract c : this.input1) {
      c.accept(visitor);
    }
    for (    Contract c : this.input2) {
      c.accept(visitor);
    }
    visitor.postVisit(this);
  }
}
Program: 55711
Project: 55711
Buggy source:
/** 
 * Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given offset.
 * @param blocks The different blocks of the file. Must be ordered by their offset.
 * @param offset The offset of the position in the file.
 * @param startIndex The earliest index to look at.
 * @return The index of the block containing the given position.
 */
private final int getBlockIndexForPosition(BlockLocation[] blocks,long offset,long halfSplitSize,int startIndex){
  for (int i=startIndex; i < blocks.length; i++) {
    long blockStart=blocks[i].getOffset();
    long blockEnd=blockStart + blocks[i].getLength();
    if (offset >= blockStart && offset < blockEnd) {
      if (i < blocks.length - 1 && blockEnd - offset < halfSplitSize) {
        return i + 1;
      }
 else {
        return i;
      }
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Retrieves the index of the <tt>BlockLocation</tt> that contains the part of the file described by the given offset.
 * @param blocks The different blocks of the file. Must be ordered by their offset.
 * @param offset The offset of the position in the file.
 * @param startIndex The earliest index to look at.
 * @return The index of the block containing the given position.
 */
protected final int getBlockIndexForPosition(BlockLocation[] blocks,long offset,long halfSplitSize,int startIndex){
  for (int i=startIndex; i < blocks.length; i++) {
    long blockStart=blocks[i].getOffset();
    long blockEnd=blockStart + blocks[i].getLength();
    if (offset >= blockStart && offset < blockEnd) {
      if (i < blocks.length - 1 && blockEnd - offset < halfSplitSize) {
        return i + 1;
      }
 else {
        return i;
      }
    }
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 55712
Project: 55712
Buggy source:
/** 
 * Opens an input stream to the file defined in the input format. The stream is positioned at the beginning of the given split. <p> The stream is actually opened in an asynchronous thread to make sure any interruptions to the thread  working on the input format do not reach the file system.
 * @see eu.stratosphere.pact.common.io.InputFormat#open(eu.stratosphere.nephele.template.InputSplit)
 */
@Override public void open(FileInputSplit split) throws IOException {
  if (!(split instanceof FileInputSplit)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final FileInputSplit fileSplit=(FileInputSplit)split;
  this.start=fileSplit.getStart();
  this.length=fileSplit.getLength();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str");
  final InputSplitOpenThread isot=new InputSplitOpenThread(fileSplit,OPEN_TIMEOUT_MILLIES);
  isot.start();
  try {
    isot.waitForCompletion();
  }
 catch (  Throwable t) {
    throw new IOException("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str"+ t.getMessage(),t);
  }
  this.stream=isot.getFSDataInputStream();
  this.stream.seek(this.start);
}

Fixed version (ground truth):
/** 
 * Opens an input stream to the file defined in the input format. The stream is positioned at the beginning of the given split. <p> The stream is actually opened in an asynchronous thread to make sure any interruptions to the thread  working on the input format do not reach the file system.
 * @see eu.stratosphere.pact.common.io.InputFormat#open(eu.stratosphere.nephele.template.InputSplit)
 */
@Override public void open(FileInputSplit split) throws IOException {
  if (!(split instanceof FileInputSplit)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final FileInputSplit fileSplit=(FileInputSplit)split;
  fileNumber=Integer.parseInt(split.getPath().getName());
  this.start=fileSplit.getStart();
  this.length=fileSplit.getLength();
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str");
  final InputSplitOpenThread isot=new InputSplitOpenThread(fileSplit,OPEN_TIMEOUT_MILLIES);
  isot.start();
  try {
    isot.waitForCompletion();
  }
 catch (  Throwable t) {
    throw new IOException("String_Node_Str" + fileSplit.getPath() + "String_Node_Str"+ start+ "String_Node_Str"+ length+ "String_Node_Str"+ t.getMessage(),t);
  }
  this.stream=isot.getFSDataInputStream();
  this.stream.seek(this.start);
}
Program: 55713
Project: 55713
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public T readRecord(final T target) throws IOException, InterruptedException {
  T record=null;
  if (this.executingThread == null) {
    this.executingThread=Thread.currentThread();
  }
  if (this.executingThread.isInterrupted()) {
    throw new InterruptedException();
  }
  while (true) {
    if (this.channelToReadFrom == -1) {
      this.availableChannelRetVal=waitForAnyChannelToBecomeAvailable();
      this.channelToReadFrom=this.availableChannelRetVal;
    }
    try {
      record=this.getInputChannel(this.channelToReadFrom).readRecord(target);
    }
 catch (    EOFException e) {
      if (this.isClosed()) {
        return null;
      }
    }
    if (++this.channelToReadFrom == getNumberOfInputChannels()) {
      this.channelToReadFrom=0;
    }
    if (record != null) {
      break;
    }
 else {
      if (this.channelToReadFrom == this.availableChannelRetVal) {
        this.channelToReadFrom=-1;
      }
    }
  }
  this.streamListener.recordReceived(record);
  return record;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T readRecord(final T target) throws IOException, InterruptedException {
  T record=null;
  if (this.executingThread == null) {
    this.executingThread=Thread.currentThread();
  }
  if (this.executingThread.isInterrupted()) {
    throw new InterruptedException();
  }
  final int numberOfInputChannels=getNumberOfInputChannels();
  while (true) {
    if (this.channelToReadFrom == -1) {
      this.availableChannelRetVal=waitForAnyChannelToBecomeAvailable();
      this.channelToReadFrom=this.availableChannelRetVal;
    }
    try {
      record=this.getInputChannel(this.channelToReadFrom).readRecord(target);
    }
 catch (    EOFException e) {
      if (this.isClosed()) {
        return null;
      }
    }
    if (record == null && this.channelToReadFrom == this.availableChannelRetVal) {
      this.channelToReadFrom=-1;
      continue;
    }
    if (++this.channelToReadFrom == numberOfInputChannels) {
      this.channelToReadFrom=0;
    }
    if (record != null) {
      break;
    }
  }
  this.streamListener.recordReceived(record);
  return record;
}
Program: 55714
Project: 55714
Buggy source:
private void initBufferSizes(){
  int bufferSize=GlobalConfiguration.getInteger("String_Node_Str",GlobalBufferPool.DEFAULT_BUFFER_SIZE_IN_BYTES);
  long now=System.currentTimeMillis();
  for (  ProfilingPath path : profilingModel.getProfilingSubgraph().getProfilingPaths()) {
    for (    ManagementAttachment pathElement : path.getPathElements()) {
      if (pathElement instanceof ManagementEdge) {
        ManagementEdge edge=(ManagementEdge)pathElement;
        BufferSizeHistory bufferSizeHistory=new BufferSizeHistory(edge,2);
        bufferSizeHistory.addToHistory(now,bufferSize);
        bufferSizes.put(edge,bufferSizeHistory);
      }
    }
  }
}

Fixed version (ground truth):
private void initBufferSizes(){
  int bufferSize=GlobalConfiguration.getInteger("String_Node_Str",GlobalBufferPool.DEFAULT_BUFFER_SIZE_IN_BYTES);
  this.maximumBufferSize=bufferSize;
  long now=System.currentTimeMillis();
  for (  ProfilingPath path : profilingModel.getProfilingSubgraph().getProfilingPaths()) {
    for (    ManagementAttachment pathElement : path.getPathElements()) {
      if (pathElement instanceof ManagementEdge) {
        ManagementEdge edge=(ManagementEdge)pathElement;
        BufferSizeHistory bufferSizeHistory=new BufferSizeHistory(edge,2);
        bufferSizeHistory.addToHistory(now,bufferSize);
        bufferSizes.put(edge,bufferSizeHistory);
      }
    }
  }
}
Program: 55715
Project: 55715
Buggy source:
private void increaseBufferSize(ManagementEdge edge,HashMap<ManagementEdge,Integer> edgesToAdjust){
  int oldBufferSize=bufferSizes.get(edge).getLastEntry().getBufferSize();
  int newBufferSize=proposedIncreasedBufferSize(oldBufferSize);
  edgesToAdjust.put(edge,newBufferSize);
}

Fixed version (ground truth):
private void increaseBufferSize(ManagementEdge edge,HashMap<ManagementEdge,Integer> edgesToAdjust){
  int oldBufferSize=bufferSizes.get(edge).getLastEntry().getBufferSize();
  int newBufferSize=Math.min(proposedIncreasedBufferSize(oldBufferSize),this.maximumBufferSize);
  if (isRelevantIncrease(oldBufferSize,newBufferSize)) {
    edgesToAdjust.put(edge,newBufferSize);
  }
}
Program: 55716
Project: 55716
Buggy source:
public void refreshEdgeLatency(long timestamp,ChannelLatency channelLatency){
  ManagementEdgeID sourceEdgeID=profilingSubgraph.getEdgeByReceiverVertexID(channelLatency.getSinkVertexID().toManagementVertexID());
  EdgeCharacteristics edgeCharacteristics=profilingSubgraph.getEdgeCharacteristicsBySourceEdgeID(sourceEdgeID);
  edgeCharacteristics.addLatencyMeasurement(timestamp,channelLatency.getChannelLatency());
}

Fixed version (ground truth):
public void refreshEdgeLatency(long timestamp,ChannelLatency channelLatency){
  if (Double.isInfinite(channelLatency.getChannelLatency()) || Double.isNaN(channelLatency.getChannelLatency())) {
    return;
  }
  if (!channelLatency.getSourceVertexID().equals(channelLatency.getSinkVertexID())) {
    XoredVertexID xored=new XoredVertexID(channelLatency.getSourceVertexID().toManagementVertexID(),channelLatency.getSinkVertexID().toManagementVertexID());
    ManagementEdgeID sourceEdgeID=profilingSubgraph.getSourceEdgeIDByXoredVertexID(xored);
    if (sourceEdgeID == null) {
      ExecutionVertex source=executionGraph.getVertexByID(channelLatency.getSourceVertexID());
      ExecutionVertex sink=executionGraph.getVertexByID(channelLatency.getSinkVertexID());
      throw new RuntimeException("String_Node_Str" + getName(source) + "String_Node_Str"+ getName(sink)+ "String_Node_Str"+ xored.toString());
    }
    EdgeCharacteristics edgeCharacteristics=profilingSubgraph.getEdgeCharacteristicsBySourceEdgeID(sourceEdgeID);
    edgeCharacteristics.addLatencyMeasurement(timestamp,channelLatency.getChannelLatency());
  }
}
Program: 55717
Project: 55717
Buggy source:
public void refreshChannelThroughput(long timestamp,ChannelThroughput channelThroughput){
  ManagementEdgeID edgeID=new ManagementEdgeID(channelThroughput.getSourceChannelID());
  EdgeCharacteristics edgeCharaceristics=profilingSubgraph.getEdgeCharacteristicsBySourceEdgeID(edgeID);
  edgeCharaceristics.addThroughputMeasurement(timestamp,channelThroughput.getThroughput());
}

Fixed version (ground truth):
public void refreshChannelThroughput(long timestamp,ChannelThroughput channelThroughput){
  if (Double.isInfinite(channelThroughput.getThroughput()) || Double.isNaN(channelThroughput.getThroughput())) {
    return;
  }
  ManagementEdgeID edgeID=new ManagementEdgeID(channelThroughput.getSourceChannelID());
  EdgeCharacteristics edgeCharaceristics=profilingSubgraph.getEdgeCharacteristicsBySourceEdgeID(edgeID);
  edgeCharaceristics.addThroughputMeasurement(timestamp,channelThroughput.getThroughput());
}
Program: 55718
Project: 55718
Buggy source:
public void refreshTaskLatency(long timestamp,TaskLatency taskLatency){
  VertexLatency vertexLatency=profilingSubgraph.getVertexLatency(taskLatency.getVertexID().toManagementVertexID());
  vertexLatency.addLatencyMeasurement(timestamp,taskLatency.getTaskLatency());
}

Fixed version (ground truth):
public void refreshTaskLatency(long timestamp,TaskLatency taskLatency){
  if (Double.isInfinite(taskLatency.getTaskLatency()) || Double.isNaN(taskLatency.getTaskLatency())) {
    return;
  }
  VertexLatency vertexLatency=profilingSubgraph.getVertexLatency(taskLatency.getVertexID().toManagementVertexID());
  vertexLatency.addLatencyMeasurement(timestamp,taskLatency.getTaskLatency());
}
Program: 55719
Project: 55719
Buggy source:
private void initReceiverVertexToSourceEdgeIDMap(final ManagementGraph managementGraph){
  final Iterator<ManagementVertex> it=new ManagementGraphIterator(managementGraph,true);
  while (it.hasNext()) {
    final ManagementVertex source=it.next();
    final int numberOfOutputGates=source.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final ManagementGate outputGate=source.getOutputGate(i);
      final int numberOfOutgoingEdges=outputGate.getNumberOfForwardEdges();
      for (int j=0; j < numberOfOutgoingEdges; ++j) {
        final ManagementEdge edge=outputGate.getForwardEdge(j);
        final ManagementVertex receiver=edge.getTarget().getVertex();
        this.receiverVertexToSourceEdgeIDMap.put(receiver.getID(),edge.getSourceEdgeID());
      }
    }
  }
}

Fixed version (ground truth):
private void initReceiverVertexToSourceEdgeIDMap(final ManagementGraph managementGraph){
  final Iterator<ManagementVertex> it=new ManagementGraphIterator(managementGraph,true);
  while (it.hasNext()) {
    final ManagementVertex source=it.next();
    final int numberOfOutputGates=source.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final ManagementGate outputGate=source.getOutputGate(i);
      final int numberOfOutgoingEdges=outputGate.getNumberOfForwardEdges();
      for (int j=0; j < numberOfOutgoingEdges; ++j) {
        final ManagementEdge edge=outputGate.getForwardEdge(j);
        final ManagementVertex receiver=edge.getTarget().getVertex();
        XoredVertexID xored=new XoredVertexID(source.getID(),receiver.getID());
        System.out.println("String_Node_Str" + getName(source) + "String_Node_Str"+ getName(receiver)+ "String_Node_Str"+ xored.toString());
        this.xoredVertexToSourceEdgeIDMap.put(xored,edge.getSourceEdgeID());
      }
    }
  }
}
Program: 55720
Project: 55720
Buggy source:
@Override public StringBuilder toString(StringBuilder sb){
  for (  final JsonNode row : this.getRows())   sb.append("String_Node_Str").append(row).append("String_Node_Str").append(this.get(row)).append("String_Node_Str");
  return sb.append("String_Node_Str");
}

Fixed version (ground truth):
@Override public StringBuilder toString(StringBuilder sb){
  for (  final JsonNode row : this.getRows())   sb.append("String_Node_Str").append(row).append("String_Node_Str").append(this.get(row)).append("String_Node_Str");
  return sb;
}
Program: 55721
Project: 55721
Buggy source:
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),2,1);
  JsonStream phase1=sopremoModule.getInput(0);
  JsonStream matrix=sopremoModule.getInput(1);
  final TransformDiagonal transDia=new TransformDiagonal().withInputs(phase1);
  final GenerateRows rows=new GenerateRows().withInputs(matrix);
  final ComputeBlockTuples computeRows=new ComputeBlockTuples().withInputs(transDia,rows);
  sopremoModule.getOutput(0).setInput(0,computeRows);
  return sopremoModule;
}

Fixed version (ground truth):
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),2,1);
  JsonStream phase1=sopremoModule.getInput(0);
  JsonStream matrix=sopremoModule.getInput(1);
  final TransformDiagonal transDia=new TransformDiagonal().withInputs(phase1);
  final GenerateRows rows=new GenerateRows().withInputs(matrix);
  final ComputeBlockTuples computeRows=new ComputeBlockTuples().withInputs(transDia,rows);
  final ExtractMirroredMatrix mirroredMatrix=new ExtractMirroredMatrix().withInputs(computeRows);
  final FillMatrix fillMatrix=new FillMatrix().withInputs(computeRows,mirroredMatrix);
  sopremoModule.getOutput(0).setInput(0,fillMatrix);
  return sopremoModule;
}
Program: 55722
Project: 55722
Buggy source:
@Override protected void map(JsonNode key,JsonNode value,JsonCollector out){
  ArrayNode castedKey=(ArrayNode)key;
  if (!castedKey.get(0).equals(castedKey.get(1))) {
    out.collect(castedKey.get(1),new ArrayNode(key,value));
  }
}

Fixed version (ground truth):
@Override protected void map(JsonNode key,JsonNode value,JsonCollector out){
  if (((ArrayNode)key).get(0).compareTo(((ArrayNode)key).get(1)) > 0) {
    out.collect(new ArrayNode(((ArrayNode)key).get(1),((ArrayNode)key).get(0)),value);
  }
}
Program: 55723
Project: 55723
Buggy source:
@Override protected void coGroup(JsonNode key,ArrayNode values1,ArrayNode values2,JsonCollector out){
  if (!key.isArray()) {
    for (    JsonNode array : values2) {
      out.collect(((ArrayNode)array).get(0),((ArrayNode)array).get(1));
    }
  }
 else {
    for (    JsonNode value2 : values2) {
      BinarySparseMatrix matrixB=(BinarySparseMatrix)((ArrayNode)(((ArrayNode)value2).get(0))).get(1);
      BinarySparseMatrix matrixX=(BinarySparseMatrix)((ArrayNode)(((ArrayNode)value2).get(1))).get(1);
      JsonNode oldKeyX=((ArrayNode)(((ArrayNode)value2).get(1))).get(0);
      if (!values1.isEmpty()) {
      }
 else {
        JsonNode oldKeyB=((ArrayNode)(((ArrayNode)value2).get(0))).get(0);
        out.collect(oldKeyB,matrixB);
      }
      out.collect(oldKeyX,matrixX);
    }
  }
}

Fixed version (ground truth):
@Override protected void coGroup(JsonNode key,ArrayNode values1,ArrayNode values2,JsonCollector out){
  if (!key.isArray()) {
    for (    JsonNode array : values2) {
      out.collect(((ArrayNode)array).get(0),((ArrayNode)array).get(1));
    }
  }
 else {
    if (values2.isEmpty()) {
      out.collect(key,values1.get(0));
    }
 else {
      for (      JsonNode value2 : values2) {
        BinarySparseMatrix matrixB=(BinarySparseMatrix)((ArrayNode)(((ArrayNode)value2).get(0))).get(1);
        BinarySparseMatrix matrixX=(BinarySparseMatrix)((ArrayNode)(((ArrayNode)value2).get(1))).get(1);
        JsonNode oldKeyX=((ArrayNode)(((ArrayNode)value2).get(1))).get(0);
        if (!values1.isEmpty()) {
        }
        out.collect(oldKeyX,matrixX);
      }
    }
  }
}