nus-yam/ex-repair huggingface dataset:
Program: 87796
Project: 87796
Buggy source:
RuntimeInputGateContext(final String taskName,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate){
  final String poolOwnerName=(taskName == null ? "String_Node_Str" : taskName + "String_Node_Str" + inputGate.getIndex()+ "String_Node_Str");
  this.localBufferPool=new LocalBufferPool(poolOwnerName,1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
}

Fixed version (ground truth):
RuntimeInputGateContext(final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate){
  this.localBufferPool=new LocalBufferPool(1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
}
Program: 87797
Project: 87797
Buggy source:
RuntimeTaskContext(final RuntimeTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final Map<ExecutionVertexID,RuntimeTaskContext> tasksWithUndecidedCheckpoints){
  final String poolOwnerName=(task.getEnvironment().getTaskName() == null ? "String_Node_Str" : task.getEnvironment().getTaskName());
  this.localBufferPool=new LocalBufferPool(poolOwnerName,1,false,this);
  this.task=task;
  final RuntimeEnvironment environment=task.getRuntimeEnvironment();
  int nooc=0;
  boolean ephemeral=true;
  for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
    final OutputGate<? extends Record> outputGate=environment.getOutputGate(i);
    nooc+=outputGate.getNumberOfOutputChannels();
    if (outputGate.getChannelType() == ChannelType.FILE) {
      ephemeral=false;
    }
  }
  this.numberOfOutputChannels=nooc;
  this.ephemeralCheckpoint=new EphemeralCheckpoint(task,ephemeral);
  if (ephemeral) {
    tasksWithUndecidedCheckpoints.put(task.getVertexID(),this);
  }
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.runtimeDispatcher=new RuntimeDispatcher(transferEnvelopeDispatcher);
}

Fixed version (ground truth):
RuntimeTaskContext(final RuntimeTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final Map<ExecutionVertexID,RuntimeTaskContext> tasksWithUndecidedCheckpoints){
  this.localBufferPool=new LocalBufferPool(1,false,this);
  this.task=task;
  final RuntimeEnvironment environment=task.getRuntimeEnvironment();
  int nooc=0;
  boolean ephemeral=true;
  for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
    final OutputGate<? extends Record> outputGate=environment.getOutputGate(i);
    nooc+=outputGate.getNumberOfOutputChannels();
    if (outputGate.getChannelType() == ChannelType.FILE) {
      ephemeral=false;
    }
  }
  this.numberOfOutputChannels=nooc;
  this.ephemeralCheckpoint=new EphemeralCheckpoint(task,ephemeral);
  if (ephemeral) {
    tasksWithUndecidedCheckpoints.put(task.getVertexID(),this);
  }
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.runtimeDispatcher=new RuntimeDispatcher(transferEnvelopeDispatcher);
}
Program: 87798
Project: 87798
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.clear();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.destroy();
}
Program: 87799
Project: 87799
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InputGateContext createInputGateContext(final GateID gateID){
  if (gateID == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  InputGate<? extends Record> inputGate=null;
  final RuntimeEnvironment re=this.task.getRuntimeEnvironment();
  for (int i=0; i < re.getNumberOfInputGates(); ++i) {
    final InputGate<? extends Record> candidateGate=re.getInputGate(i);
    if (candidateGate.getGateID().equals(gateID)) {
      inputGate=candidateGate;
      break;
    }
  }
  if (inputGate == null) {
    throw new IllegalStateException("String_Node_Str" + gateID);
  }
  return new RuntimeInputGateContext(this.task.getEnvironment().getTaskName(),this.transferEnvelopeDispatcher,inputGate);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InputGateContext createInputGateContext(final GateID gateID){
  if (gateID == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  InputGate<? extends Record> inputGate=null;
  final RuntimeEnvironment re=this.task.getRuntimeEnvironment();
  for (int i=0; i < re.getNumberOfInputGates(); ++i) {
    final InputGate<? extends Record> candidateGate=re.getInputGate(i);
    if (candidateGate.getGateID().equals(gateID)) {
      inputGate=candidateGate;
      break;
    }
  }
  if (inputGate == null) {
    throw new IllegalStateException("String_Node_Str" + gateID);
  }
  return new RuntimeInputGateContext(this.transferEnvelopeDispatcher,inputGate);
}
Program: 87801
Project: 87801
Buggy source:
public boolean keepsUniqueProperty(FieldSet uniqueSet,int input){
  for (  Integer uniqueField : uniqueSet) {
    if (isFieldKept(uniqueField,input) == false) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean keepsUniqueProperty(FieldSet uniqueSet,int input){
  for (  Integer uniqueField : uniqueSet) {
    if (isFieldKept(input,uniqueField) == false) {
      return false;
    }
  }
  return true;
}
Program: 87802
Project: 87802
Buggy source:
private void recycleBuffer(final ByteBuffer byteBuffer){
synchronized (this.buffers) {
    if (this.isDestroyed) {
      this.globalBufferPool.releaseGlobalBuffer(this.buffers.poll());
      this.requestedNumberOfBuffers--;
      return;
    }
    this.buffers.add(byteBuffer);
    this.buffers.notify();
  }
}

Fixed version (ground truth):
private void recycleBuffer(final ByteBuffer byteBuffer){
synchronized (this.buffers) {
    if (this.isDestroyed) {
      this.globalBufferPool.releaseGlobalBuffer(byteBuffer);
      this.requestedNumberOfBuffers--;
      return;
    }
    this.buffers.add(byteBuffer);
    this.buffers.notify();
  }
}
Program: 87803
Project: 87803
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<TaskSubmissionResult> submitTasks(final List<TaskSubmissionWrapper> tasks) throws IOException {
  final List<TaskSubmissionResult> submissionResultList=new SerializableArrayList<TaskSubmissionResult>();
  final List<Task> tasksToStart=new ArrayList<Task>();
  for (  final TaskSubmissionWrapper tsw : tasks) {
    final RuntimeEnvironment re=tsw.getEnvironment();
    final ExecutionVertexID id=tsw.getVertexID();
    final Configuration jobConfiguration=tsw.getConfiguration();
    final Set<ChannelID> activeOutputChannels=tsw.getActiveOutputChannels();
    final Task task=createAndRegisterTask(id,jobConfiguration,re,activeOutputChannels);
    if (task == null) {
      final TaskSubmissionResult result=new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
      result.setDescription("String_Node_Str" + id + "String_Node_Str");
      LOG.error(result.getDescription());
      submissionResultList.add(result);
    }
 else {
      submissionResultList.add(new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.SUCCESS));
    }
    tasksToStart.add(task);
  }
  for (  final Task task : tasksToStart) {
    task.startExecution();
  }
  return submissionResultList;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<TaskSubmissionResult> submitTasks(final List<TaskSubmissionWrapper> tasks) throws IOException {
  final List<TaskSubmissionResult> submissionResultList=new SerializableArrayList<TaskSubmissionResult>();
  final List<Task> tasksToStart=new ArrayList<Task>();
  for (  final TaskSubmissionWrapper tsw : tasks) {
    final RuntimeEnvironment re=tsw.getEnvironment();
    final ExecutionVertexID id=tsw.getVertexID();
    final Configuration jobConfiguration=tsw.getConfiguration();
    final Set<ChannelID> activeOutputChannels=tsw.getActiveOutputChannels();
    final Task task=createAndRegisterTask(id,jobConfiguration,re,activeOutputChannels);
    if (task == null) {
      final TaskSubmissionResult result=new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
      result.setDescription("String_Node_Str" + re.getTaskNameWithIndex() + "String_Node_Str"+ id+ "String_Node_Str");
      LOG.error(result.getDescription());
      submissionResultList.add(result);
    }
 else {
      submissionResultList.add(new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.SUCCESS));
      tasksToStart.add(task);
    }
  }
  for (  final Task task : tasksToStart) {
    task.startExecution();
  }
  return submissionResultList;
}
Program: 87804
Project: 87804
Buggy source:
/** 
 * Returns the key column numbers for the specific input if it is preserved by this node. Null, otherwise.
 * @param input
 * @return
 */
protected int[] getConstantKeySet(int input){
  int[] keyColumns=null;
  Contract contract=getPactContract();
  if (contract instanceof AbstractPact<?>) {
    AbstractPact<?> abstractPact=(AbstractPact<?>)contract;
    keyColumns=abstractPact.getKeyColumnNumbers(input);
    if (keyColumns != null) {
      for (      int keyColumn : keyColumns) {
        if (isFieldKept(input,keyColumn) == false) {
          keyColumns=null;
          break;
        }
      }
    }
  }
  return keyColumns;
}

Fixed version (ground truth):
/** 
 * Returns the key column numbers for the specific input if it is preserved by this node. Null, otherwise.
 * @param input
 * @return
 */
protected int[] getConstantKeySet(int input){
  int[] keyColumns=null;
  Contract contract=getPactContract();
  if (contract instanceof AbstractPact<?>) {
    AbstractPact<?> abstractPact=(AbstractPact<?>)contract;
    keyColumns=abstractPact.getKeyColumnNumbers(input);
    if (keyColumns != null) {
      if (keyColumns.length == 0) {
        return null;
      }
      for (      int keyColumn : keyColumns) {
        if (isFieldKept(input,keyColumn) == false) {
          return null;
        }
      }
    }
  }
  return keyColumns;
}
Program: 87807
Project: 87807
Buggy source:
public void runIOLoop(){
  long interval=GlobalConfiguration.getInteger("String_Node_Str",DEFAULTPERIODICTASKSINTERVAL);
  while (!Thread.interrupted()) {
    try {
      Thread.sleep(interval);
    }
 catch (    InterruptedException e1) {
      LOG.debug("String_Node_Str");
      break;
    }
    try {
      this.jobManager.sendHeartbeat(this.localInstanceConnectionInfo,this.hardwareDescription);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str");
    }
    checkTaskExecution();
    this.byteBufferedChannelManager.cleanUpRecentlyRemovedChannelIDSet();
  }
  shutdown();
}

Fixed version (ground truth):
public void runIOLoop(){
  long interval=GlobalConfiguration.getInteger("String_Node_Str",DEFAULTPERIODICTASKSINTERVAL);
  while (!Thread.interrupted()) {
    try {
      Thread.sleep(interval);
    }
 catch (    InterruptedException e1) {
      LOG.debug("String_Node_Str");
      break;
    }
    try {
      this.jobManager.sendHeartbeat(this.localInstanceConnectionInfo,this.hardwareDescription);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str");
    }
    checkTaskExecution();
  }
  shutdown();
}
Program: 87808
Project: 87808
Buggy source:
private void sendReceiverNotFoundEvent(final JobID jobID,final ChannelID unknownReceiver){
  if (ChannelID.SYSTEM_ID.equals(unknownReceiver)) {
    LOG.error("String_Node_Str");
    return;
  }
  final TransferEnvelope transferEnvelope=new TransferEnvelope(0,jobID,ChannelID.SYSTEM_ID);
  final UnknownReceiverEvent unknownReceiverEvent=new UnknownReceiverEvent(unknownReceiver);
  transferEnvelope.addEvent(unknownReceiverEvent);
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,unknownReceiver);
  if (receiverList == null) {
    LOG.error("String_Node_Str" + unknownReceiver);
    return;
  }
  processEnvelopeEnvelopeWithoutBuffer(transferEnvelope,receiverList);
}

Fixed version (ground truth):
private void sendReceiverNotFoundEvent(final TransferEnvelope envelope,final ChannelID unknownReceiver){
  if (ChannelID.SYSTEM_ID.equals(envelope.getSource())) {
    LOG.error("String_Node_Str");
    return;
  }
  final JobID jobID=envelope.getJobID();
  final TransferEnvelope transferEnvelope=new TransferEnvelope(0,jobID,ChannelID.SYSTEM_ID);
  final ReceiverNotFoundEvent unknownReceiverEvent=new ReceiverNotFoundEvent(unknownReceiver,envelope.getSequenceNumber());
  transferEnvelope.addEvent(unknownReceiverEvent);
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,unknownReceiver);
  if (receiverList == null) {
    LOG.error("String_Node_Str" + unknownReceiver);
    return;
  }
  processEnvelopeEnvelopeWithoutBuffer(transferEnvelope,receiverList);
}
Program: 87812
Project: 87812
Buggy source:
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + localReceiver + "String_Node_Str"+ transferEnvelope.getJobID());
      }
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}

Fixed version (ground truth):
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      sendReceiverNotFoundEvent(transferEnvelope,localReceiver);
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}
Program: 87813
Project: 87813
Buggy source:
@Override public BufferProvider getBufferProvider(final JobID jobID,final ChannelID sourceChannelID) throws IOException, InterruptedException {
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,sourceChannelID);
  if (receiverList.hasLocalReceivers() && !receiverList.hasRemoteReceivers()) {
    final List<ChannelID> localReceivers=receiverList.getLocalReceivers();
    if (localReceivers.size() == 1) {
      final ChannelID localReceiver=localReceivers.get(0);
      final ChannelContext cc=this.registeredChannels.get(localReceiver);
      if (cc == null) {
        if (this.recentlyRemovedChannelIDSet.contains(localReceiver)) {
          return this.transitBufferPool;
        }
 else {
          throw new IOException("String_Node_Str" + localReceiver);
        }
      }
      if (!cc.isInputChannel()) {
        throw new IOException("String_Node_Str" + localReceiver + "String_Node_Str");
      }
      final InputChannelContext icc=(InputChannelContext)cc;
      return icc;
    }
  }
  return this.transitBufferPool;
}

Fixed version (ground truth):
@Override public BufferProvider getBufferProvider(final JobID jobID,final ChannelID sourceChannelID) throws IOException, InterruptedException {
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,sourceChannelID);
  if (receiverList.hasLocalReceivers() && !receiverList.hasRemoteReceivers()) {
    final List<ChannelID> localReceivers=receiverList.getLocalReceivers();
    if (localReceivers.size() == 1) {
      final ChannelID localReceiver=localReceivers.get(0);
      final ChannelContext cc=this.registeredChannels.get(localReceiver);
      if (cc == null) {
        return this.transitBufferPool;
      }
      if (!cc.isInputChannel()) {
        throw new IOException("String_Node_Str" + localReceiver + "String_Node_Str");
      }
      final InputChannelContext icc=(InputChannelContext)cc;
      return icc;
    }
  }
  return this.transitBufferPool;
}
Program: 87814
Project: 87814
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return (!this.closeAcknowledgementReceived);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  if (this.closeAcknowledgementReceived) {
    return false;
  }
  if ((this.lastSequenceNumberWithReceiverNotFound + 1) == this.sequenceNumber) {
    return false;
  }
  return true;
}
Program: 87815
Project: 87815
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else   if (event instanceof AbstractTaskEvent) {
    this.byteBufferedOutputChannel.processEvent(event);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else   if (event instanceof ReceiverNotFoundEvent) {
    this.lastSequenceNumberWithReceiverNotFound=((ReceiverNotFoundEvent)event).getSequenceNumber();
  }
 else   if (event instanceof AbstractTaskEvent) {
    this.byteBufferedOutputChannel.processEvent(event);
  }
}
Program: 87816
Project: 87816
Buggy source:
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}

Fixed version (ground truth):
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}
Program: 87817
Project: 87817
Buggy source:
boolean hasFinished(){
  return (!this.forwardingChain.anyForwarderHasDataLeft());
}

Fixed version (ground truth):
boolean hasFinished(){
  this.incomingEventQueue.processQueuedEvents();
  return (!this.forwardingChain.anyForwarderHasDataLeft());
}
Program: 87818
Project: 87818
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return (!this.closeAcknowledgementReceived);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return false;
}
Program: 87819
Project: 87819
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else {
    System.out.println("String_Node_Str" + event);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    LOG.info("String_Node_Str");
  }
 else {
    LOG.warn("String_Node_Str" + event);
  }
}
Program: 87820
Project: 87820
Buggy source:
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}

Fixed version (ground truth):
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING || unchangedExecutionState == ExecutionState.FINISHING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && (unchangedExecutionState == ExecutionState.FINISHING || unchangedExecutionState == ExecutionState.FINISHED)) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}
Program: 87821
Project: 87821
Buggy source:
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}

Fixed version (ground truth):
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (!this.executionObserver.isCanceled()) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}
Program: 87822
Project: 87822
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean isCanceled(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isCanceled()) {
      return true;
    }
  }
  return isCanceled;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isCanceled(){
  if (this.encapsulatedRuntimeTask != null) {
    if (this.encapsulatedRuntimeTask.isCanceled()) {
      return true;
    }
  }
  return isCanceled;
}
Program: 87823
Project: 87823
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean isTerminated(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isTerminated()) {
      return true;
    }
  }
  final Thread executingThread=this.environment.getExecutingThread();
  if (executingThread.getState() == Thread.State.TERMINATED) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isTerminated(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isTerminated()) {
      if (this.encapsulatedExecutionState != ExecutionState.FINISHED && this.encapsulatedExecutionState != ExecutionState.CANCELED && this.encapsulatedExecutionState != ExecutionState.FAILED) {
        return true;
      }
    }
  }
  final Thread executingThread=this.environment.getExecutingThread();
  if (executingThread.getState() == Thread.State.TERMINATED) {
    if (this.replayTaskExecutionState != ExecutionState.FINISHED && this.replayTaskExecutionState != ExecutionState.CANCELED && this.replayTaskExecutionState != ExecutionState.FAILED) {
      return true;
    }
  }
  return false;
}
Program: 87824
Project: 87824
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Thread userThread){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.userThreadFinished(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Thread userThread){
  if (this.encapsulatedRuntimeTask != null) {
    this.encapsulatedRuntimeTask.userThreadFinished(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}
Program: 87825
Project: 87825
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void markAsFailed(){
  this.replayTaskExecutionState=ExecutionState.FAILED;
  reportExecutionStateChange(true,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void markAsFailed(){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.killExecution();
  }
  this.replayTaskExecutionState=ExecutionState.FAILED;
  reportExecutionStateChange(true,"String_Node_Str");
}
Program: 87826
Project: 87826
Buggy source:
private ReplayTaskExecutionObserver(final RuntimeTask encapsulatedTask){
  this.encapsulatedTask=encapsulatedTask;
}

Fixed version (ground truth):
private ReplayTaskExecutionObserver(final RuntimeTask encapsulatedRuntimeTask){
  this.encapsulatedRuntimeTask=encapsulatedRuntimeTask;
}
Program: 87827
Project: 87827
Buggy source:
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  return null;
}

Fixed version (ground truth):
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}
Program: 87828
Project: 87828
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.encapsulatedTask == null) {
    replayTaskExecutionState=newExecutionState;
  }
 else {
    encapsulatedExecutionState=newExecutionState;
  }
  reportExecutionStateChange((this.encapsulatedTask == null),optionalMessage);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.encapsulatedRuntimeTask == null) {
    replayTaskExecutionState=newExecutionState;
    if (newExecutionState == ExecutionState.FAILED) {
      if (encapsulatedTask != null) {
        encapsulatedTask.killExecution();
      }
    }
  }
 else {
    encapsulatedExecutionState=newExecutionState;
    if (newExecutionState == ExecutionState.FAILED) {
      killExecution();
    }
  }
  reportExecutionStateChange((this.encapsulatedRuntimeTask == null),optionalMessage);
}
Program: 87829
Project: 87829
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Thread userThread){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.userThreadStarted(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Thread userThread){
  if (this.encapsulatedRuntimeTask != null) {
    this.encapsulatedRuntimeTask.userThreadStarted(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}
Program: 87830
Project: 87830
Buggy source:
/** 
 * This method is periodically called by the framework to check the state of the task threads. If any task thread has unexpectedly switch to TERMINATED, this indicates that an   {@link Error} has occurredduring its execution.
 */
private void checkTaskExecution(){
  final List<Task> failedTasks=new ArrayList<Task>();
synchronized (this.runningTasks) {
    final Iterator<ExecutionVertexID> it=this.runningTasks.keySet().iterator();
    while (it.hasNext()) {
      final ExecutionVertexID executionVertexID=it.next();
      final Task task=this.runningTasks.get(executionVertexID);
      if (task.isTerminated()) {
        it.remove();
        failedTasks.add(task);
      }
    }
  }
  final Iterator<Task> it2=failedTasks.iterator();
  while (it2.hasNext()) {
    it2.next().markAsFailed();
  }
}

Fixed version (ground truth):
/** 
 * This method is periodically called by the framework to check the state of the task threads. If any task thread has unexpectedly switch to TERMINATED, this indicates that an   {@link Error} has occurredduring its execution.
 */
private void checkTaskExecution(){
  final Iterator<Task> it=this.runningTasks.values().iterator();
  while (it.hasNext()) {
    final Task task=it.next();
    if (task.isTerminated()) {
      task.markAsFailed();
    }
  }
}
Program: 87832
Project: 87832
Buggy source:
/** 
 * Cancels all the tasks in the current and upper stages of the given execution graph.
 * @param eg the execution graph representing the job to cancel.
 * @return <code>null</code> no error occurred during the cancel attempt,otherwise the returned object will describe the error
 */
private TaskCancelResult cancelJob(final ExecutionGraph eg){
  TaskCancelResult errorResult=null;
  final Iterator<ExecutionVertex> it=new ExecutionGraphIterator(eg,eg.getIndexOfCurrentExecutionStage(),false,true);
  while (it.hasNext()) {
    final ExecutionVertex vertex=it.next();
    final TaskCancelResult result=vertex.cancelTask();
    if (result.getReturnCode() == AbstractTaskResult.ReturnCode.ERROR) {
      errorResult=result;
    }
  }
  return errorResult;
}

Fixed version (ground truth):
/** 
 * Cancels all the tasks in the current and upper stages of the given execution graph.
 * @param eg the execution graph representing the job to cancel.
 * @return <code>null</code> if no error occurred during the cancel attempt,otherwise the returned object will describe the error
 */
private TaskCancelResult cancelJob(final ExecutionGraph eg){
  TaskCancelResult errorResult=null;
  final Iterator<ExecutionVertex> it=new ExecutionGraphIterator(eg,eg.getIndexOfCurrentExecutionStage(),false,true);
  while (it.hasNext()) {
    final ExecutionVertex vertex=it.next();
    final TaskCancelResult result=vertex.cancelTask();
    if (result.getReturnCode() == AbstractTaskResult.ReturnCode.ERROR) {
      errorResult=result;
    }
  }
  return errorResult;
}
Program: 87833
Project: 87833
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(final ExecutionVertexID id,final AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instance.getName(),instance.getType().getIdentifier());
  }
  this.eventCollector.updateManagementGraph(jobID,event);
  this.eventCollector.addEvent(this.jobID,event);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(final ExecutionVertexID id,final AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    String instanceName=null;
    if (instance.getInstanceConnectionInfo() != null) {
      instanceName=instance.getInstanceConnectionInfo().toString();
    }
 else {
      instanceName=instance.toString();
    }
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instanceName,instance.getType().getIdentifier());
  }
  this.eventCollector.updateManagementGraph(jobID,event);
  this.eventCollector.addEvent(this.jobID,event);
}
Program: 87836
Project: 87836
Buggy source:
/** 
 * Returns the associated   {@link Contract} type for the given {@link Stub} class.
 * @param stubClass the stub class
 * @return the associated Contract type
 */
@SuppressWarnings({"String_Node_Str"}) public static Class<? extends Contract> getContractClass(final Class<?> stubClass){
  final Class<?> contract=STUB_CONTRACTS.get(stubClass);
  if (contract == null && stubClass != null)   return getContractClass(stubClass.getSuperclass());
  return (Class<? extends Contract>)contract;
}

Fixed version (ground truth):
/** 
 * Returns the associated   {@link Contract} type for the given {@link Stub} class.
 * @param stubClass the stub class
 * @return the associated Contract type
 */
@SuppressWarnings({"String_Node_Str"}) public static Class<? extends Contract> getContractClass(final Class<?> stubClass){
  if (stubClass == null)   return null;
  final Class<?> contract=STUB_CONTRACTS.get(stubClass);
  if (contract != null)   return (Class<? extends Contract>)contract;
  Iterator<Entry<Class<?>,Class<? extends Contract>>> stubContracts=STUB_CONTRACTS.entrySet().iterator();
  while (stubContracts.hasNext()) {
    Map.Entry<Class<?>,Class<? extends Contract>> entry=stubContracts.next();
    if (entry.getKey().isAssignableFrom(stubClass))     return entry.getValue();
  }
  return null;
}
Program: 87837
Project: 87837
Buggy source:
private void initAdhocInputs() throws IOException {
  for (  final FileDataSource source : this.sources) {
    final TestPairs input=this.getInput(source);
    if (input.isAdhoc())     input.saveToFile(source.getFilePath());
  }
}

Fixed version (ground truth):
private void initAdhocInputs() throws IOException {
  for (  final FileDataSource source : this.sources) {
    final TestRecords input=this.getInput(source);
    if (input.isAdhoc())     input.saveToFile(source.getFilePath());
  }
}
Program: 87838
Project: 87838
Buggy source:
/** 
 * Returns the input   {@link TestPairs} associated with the <i>i</i>th inputof the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getInput(GenericDataSource<?>)} method tounambiguously set the values.
 * @param number the number of the input.
 * @return the <i>i</i>th input of the TestPlan
 */
public TestPairs getInput(final int number){
  return this.getInput(this.getDataSources().get(number));
}

Fixed version (ground truth):
/** 
 * Returns the input   {@link TestPairs} associated with the <i>i</i>th inputof the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getInput(GenericDataSource<?>)} method tounambiguously set the values.
 * @param number the number of the input.
 * @return the <i>i</i>th input of the TestPlan
 */
public TestRecords getInput(final int number){
  return this.getInput(this.getDataSources().get(number));
}
Program: 87839
Project: 87839
Buggy source:
/** 
 * Returns the output   {@link TestPairs} associated with the <i>i</i>thoutput of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getActualOutput(GenericDataSink)} method to unambiguously get thevalues.<br> The values are only meaningful after a  {@link #run()}.
 * @param number the number of the output.
 * @return the <i>i</i>th output of the TestPlan
 */
public TestPairs getActualOutput(final int number){
  return this.getActualOutput(this.getDataSinks().get(number));
}

Fixed version (ground truth):
/** 
 * Returns the output   {@link TestPairs} associated with the <i>i</i>thoutput of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getActualOutput(GenericDataSink)} method to unambiguously get thevalues.<br> The values are only meaningful after a  {@link #run()}.
 * @param number the number of the output.
 * @return the <i>i</i>th output of the TestPlan
 */
public TestRecords getActualOutput(final int number){
  return this.getActualOutput(this.getDataSinks().get(number));
}
Program: 87840
Project: 87840
Buggy source:
/** 
 * Returns the expected output   {@link TestPairs} associated with the<i>i</i>th expected output of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getExpectedOutput(GenericDataSink)} method tounambiguously set the values.
 * @param number the number of the expected output.
 * @return the <i>i</i>th expected output of the TestPlan
 */
public TestPairs getExpectedOutput(final int number,Class<? extends Value>[] schema){
  return this.getExpectedOutput(this.getDataSinks().get(number),schema);
}

Fixed version (ground truth):
/** 
 * Returns the expected output   {@link TestPairs} associated with the<i>i</i>th expected output of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getExpectedOutput(GenericDataSink)} method tounambiguously set the values.
 * @param number the number of the expected output.
 * @return the <i>i</i>th expected output of the TestPlan
 */
public TestRecords getExpectedOutput(final int number,Class<? extends Value>[] schema){
  return this.getExpectedOutput(this.getDataSinks().get(number),schema);
}
Program: 87841
Project: 87841
Buggy source:
@Override public void close() throws IOException {
  ClosableManager closableManager=new ClosableManager();
  for (  TestPairs pairs : this.inputs.values())   closableManager.add(pairs);
  for (  TestPairs pairs : this.actualOutputs.values())   closableManager.add(pairs);
  for (  TestPairs pairs : this.expectedOutputs.values())   closableManager.add(pairs);
  closableManager.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  ClosableManager closableManager=new ClosableManager();
  for (  TestRecords pairs : this.inputs.values())   closableManager.add(pairs);
  for (  TestRecords pairs : this.actualOutputs.values())   closableManager.add(pairs);
  for (  TestRecords pairs : this.expectedOutputs.values())   closableManager.add(pairs);
  closableManager.close();
}
Program: 87842
Project: 87842
Buggy source:
/** 
 * Actually builds the plan but guarantees that the output can be read without additional knowledge. Currently the   {@link SequentialOutputFormat} is used for a guaranteeddeserializable output.<br> If a data source is not  {@link SequentialOutputFormat}, it is replaced by a   {@link SplittingOutputFormat}, with two outputs: the original one and one   {@link SequentialOutputFormat}.
 */
private Plan buildPlanWithReadableSinks(){
  final Collection<FileDataSink> existingSinks=this.getDataSinks();
  final Collection<GenericDataSink> wrappedSinks=new ArrayList<GenericDataSink>();
  for (  final FileDataSink fileSink : existingSinks)   if (!fileSink.getFormatClass().equals(SequentialOutputFormat.class)) {
    TestPairs expectedValues=this.expectedOutputs.get(fileSink);
    if (expectedValues == null)     continue;
    final FileDataSink safeSink=createDefaultSink(fileSink.getName());
    safeSink.setInputs(fileSink.getInputs());
    wrappedSinks.add(fileSink);
    wrappedSinks.add(safeSink);
    this.expectedOutputs.put(safeSink,expectedValues);
    this.actualOutputs.put(safeSink,this.getActualOutput(fileSink));
    this.getActualOutput(fileSink).fromFile(SequentialInputFormat.class,safeSink.getFilePath());
  }
 else {
    wrappedSinks.add(fileSink);
    this.getActualOutput(fileSink).fromFile(SequentialInputFormat.class,fileSink.getFilePath());
  }
  return new Plan(wrappedSinks);
}

Fixed version (ground truth):
/** 
 * Actually builds the plan but guarantees that the output can be read without additional knowledge. Currently the   {@link SequentialOutputFormat} is used for a guaranteeddeserializable output.<br> If a data source is not  {@link SequentialOutputFormat}, it is replaced by a   {@link SplittingOutputFormat}, with two outputs: the original one and one   {@link SequentialOutputFormat}.
 */
private Plan buildPlanWithReadableSinks(){
  final Collection<FileDataSink> existingSinks=this.getDataSinks();
  final Collection<GenericDataSink> wrappedSinks=new ArrayList<GenericDataSink>();
  for (  final FileDataSink fileSink : existingSinks)   if (!fileSink.getFormatClass().equals(SequentialOutputFormat.class)) {
    TestRecords expectedValues=this.expectedOutputs.get(fileSink);
    if (expectedValues == null)     continue;
    final FileDataSink safeSink=createDefaultSink(fileSink.getName());
    safeSink.setInputs(fileSink.getInputs());
    wrappedSinks.add(fileSink);
    wrappedSinks.add(safeSink);
    this.expectedOutputs.put(safeSink,expectedValues);
    this.actualOutputs.put(safeSink,this.getActualOutput(fileSink));
    this.getActualOutput(fileSink).fromFile(SequentialInputFormat.class,safeSink.getFilePath());
  }
 else {
    wrappedSinks.add(fileSink);
    this.getActualOutput(fileSink).fromFile(SequentialInputFormat.class,fileSink.getFilePath());
  }
  return new Plan(wrappedSinks);
}
Program: 87843
Project: 87843
Buggy source:
private void validateResults(){
  for (  final FileDataSink sinkContract : this.getDataSinks()) {
    TestPairs expectedValues=this.expectedOutputs.get(sinkContract);
    if (sinkContract.getFormatClass() == SequentialOutputFormat.class && expectedValues != null && expectedValues.isInitialized()) {
      final TestPairs actualValues=new TestPairs();
      actualValues.fromFile(SequentialInputFormat.class,sinkContract.getFilePath());
      FuzzyTestValueMatcher fuzzyMatcher=this.getFuzzyMatcher(sinkContract);
      FuzzyTestValueSimilarity fuzzySimilarity=this.getFuzzySimilarity(sinkContract);
      try {
        actualValues.assertEquals(expectedValues,fuzzyMatcher,fuzzySimilarity);
      }
 catch (      AssertionError e) {
        AssertionError assertionError=new AssertionError(sinkContract.getName() + "String_Node_Str" + e.getMessage());
        assertionError.initCause(e.getCause());
        throw assertionError;
      }
    }
  }
}

Fixed version (ground truth):
private void validateResults(){
  for (  final FileDataSink sinkContract : this.getDataSinks()) {
    TestRecords expectedValues=this.expectedOutputs.get(sinkContract);
    if (sinkContract.getFormatClass() == SequentialOutputFormat.class && expectedValues != null && expectedValues.isInitialized()) {
      final TestRecords actualValues=new TestRecords();
      actualValues.fromFile(SequentialInputFormat.class,sinkContract.getFilePath());
      FuzzyTestValueMatcher fuzzyMatcher=this.getFuzzyMatcher(sinkContract);
      FuzzyTestValueSimilarity fuzzySimilarity=this.getFuzzySimilarity(sinkContract);
      try {
        actualValues.assertEquals(expectedValues,fuzzyMatcher,fuzzySimilarity);
      }
 catch (      AssertionError e) {
        AssertionError assertionError=new AssertionError(sinkContract.getName() + "String_Node_Str" + e.getMessage());
        assertionError.initCause(e.getCause());
        throw assertionError;
      }
    }
  }
}
Program: 87844
Project: 87844
Buggy source:
/** 
 * Checks, if this set of properties, as interesting properties, is met by the given properties.
 * @param other The properties for which to check whether they meet these properties.
 * @return True, if the properties are met, false otherwise.
 */
public boolean isMetBy(GlobalProperties other){
  if (this.partitioning != PartitionProperty.NONE) {
    if (this.partitioning == PartitionProperty.ANY) {
      if (other.partitioning == PartitionProperty.NONE) {
        return false;
      }
    }
 else     if (other.partitioning != this.partitioning) {
      return false;
    }
  }
  FieldSet otherPartitionedFields=other.getPartitionedFiels();
  if (this.partitionedFields != null) {
    if (other.partitionedFields == null) {
      return false;
    }
    if (this.partitionedFields.size() > otherPartitionedFields.size()) {
      return false;
    }
    for (    Integer fieldIndex : this.partitionedFields) {
      if (otherPartitionedFields.contains(fieldIndex) == false) {
        return false;
      }
    }
  }
  return (this.ordering == null || this.ordering.isMetBy(other.getOrdering()));
}

Fixed version (ground truth):
/** 
 * Checks, if this set of properties, as interesting properties, is met by the given properties.
 * @param other The properties for which to check whether they meet these properties.
 * @return True, if the properties are met, false otherwise.
 */
public boolean isMetBy(GlobalProperties other){
  if (this.partitioning != PartitionProperty.NONE) {
    if (this.partitioning == PartitionProperty.ANY) {
      if (other.partitioning == PartitionProperty.NONE) {
        return false;
      }
    }
 else     if (other.partitioning != this.partitioning) {
      return false;
    }
  }
  FieldSet otherPartitionedFields=other.getPartitionedFiels();
  if (this.partitionedFields != null) {
    if (other.partitionedFields == null) {
      return false;
    }
    if (this.partitionedFields.size() < otherPartitionedFields.size()) {
      return false;
    }
    if (this.partitionedFields.containsAll(otherPartitionedFields) == false) {
      return false;
    }
  }
  return (this.ordering == null || this.ordering.isMetBy(other.getOrdering()));
}
Program: 87845
Project: 87845
Buggy source:
public GlobalProperties clone() throws CloneNotSupportedException {
  return (GlobalProperties)super.clone();
}

Fixed version (ground truth):
public GlobalProperties clone() throws CloneNotSupportedException {
  GlobalProperties newProps=(GlobalProperties)super.clone();
  if (this.ordering != null) {
    newProps.ordering=this.ordering.clone();
  }
  if (this.partitionedFields != null) {
    newProps.partitionedFields=(FieldSet)this.partitionedFields.clone();
  }
  return newProps;
}