nus-yam/ex-repair huggingface dataset:
Program: 88271
Project: 88271
Buggy source:
@Override public int skipBytes(int n) throws IOException {
  if (position + n <= this.end) {
    position+=n;
    return n;
  }
 else {
    n=this.end - position;
    position=this.end;
    return n;
  }
}

Fixed version (ground truth):
@Override public int skipBytes(int n) throws IOException {
  if (this.position <= this.end - n) {
    this.position+=n;
    return n;
  }
 else {
    n=this.end - this.position;
    this.position=this.end;
    return n;
  }
}
Program: 88272
Project: 88272
Buggy source:
@Override public int getPosition(){
  return position - this.offset;
}

Fixed version (ground truth):
@Override public int getPosition(){
  return this.position - this.offset;
}
Program: 88273
Project: 88273
Buggy source:
@Override public long readLong() throws IOException {
  if (position >= 0 && position + 7 < this.end) {
    return (((long)this.memory[position++] & 0xff) << 56) | (((long)this.memory[position++] & 0xff) << 48) | (((long)this.memory[position++] & 0xff) << 40)| (((long)this.memory[position++] & 0xff) << 32)| (((long)this.memory[position++] & 0xff) << 24)| (((long)this.memory[position++] & 0xff) << 16)| (((long)this.memory[position++] & 0xff) << 8)| (((long)this.memory[position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public long readLong() throws IOException {
  if (position >= 0 && position < this.end - 7) {
    return (((long)this.memory[position++] & 0xff) << 56) | (((long)this.memory[position++] & 0xff) << 48) | (((long)this.memory[position++] & 0xff) << 40)| (((long)this.memory[position++] & 0xff) << 32)| (((long)this.memory[position++] & 0xff) << 24)| (((long)this.memory[position++] & 0xff) << 16)| (((long)this.memory[position++] & 0xff) << 8)| (((long)this.memory[position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}
Program: 88274
Project: 88274
Buggy source:
@Override public short readShort() throws IOException {
  if (position >= 0 && position + 1 < this.end) {
    return (short)((((this.memory[position++]) & 0xff) << 8) | (((this.memory[position++]) & 0xff) << 0));
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public short readShort() throws IOException {
  if (position >= 0 && position < this.end - 1) {
    return (short)((((this.memory[position++]) & 0xff) << 8) | (((this.memory[position++]) & 0xff) << 0));
  }
 else {
    throw new EOFException();
  }
}
Program: 88275
Project: 88275
Buggy source:
@Override public void readFully(byte[] b,int off,int len) throws IOException {
  if (position < this.end && position + len <= this.end && off + len <= b.length) {
    System.arraycopy(this.memory,position,b,off,len);
    position+=len;
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void readFully(byte[] b,int off,int len) throws IOException {
  if (this.position < this.end && this.position <= this.end - len && off <= b.length - len) {
    System.arraycopy(this.memory,position,b,off,len);
    position+=len;
  }
 else {
    throw new EOFException();
  }
}
Program: 88276
Project: 88276
Buggy source:
@Override public DataInputView reset(){
  position=this.offset;
  return this;
}

Fixed version (ground truth):
@Override public DataInputView reset(){
  this.position=this.offset;
  return this;
}
Program: 88277
Project: 88277
Buggy source:
@Override public boolean readBoolean() throws IOException {
  if (position < this.end) {
    return this.memory[position++] != 0;
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public boolean readBoolean() throws IOException {
  if (this.position < this.end) {
    return this.memory[this.position++] != 0;
  }
 else {
    throw new EOFException();
  }
}
Program: 88278
Project: 88278
Buggy source:
@Override public byte readByte() throws IOException {
  if (position < this.end) {
    return this.memory[position++];
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public byte readByte() throws IOException {
  if (this.position < this.end) {
    return this.memory[this.position++];
  }
 else {
    throw new EOFException();
  }
}
Program: 88279
Project: 88279
Buggy source:
@Override public int readInt() throws IOException {
  if (position >= 0 && position + 3 < this.end) {
    return ((this.memory[position++] & 0xff) << 24) | ((this.memory[position++] & 0xff) << 16) | ((this.memory[position++] & 0xff) << 8)| ((this.memory[position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public int readInt() throws IOException {
  if (this.position >= 0 && this.position < this.end - 3) {
    return ((this.memory[position++] & 0xff) << 24) | ((this.memory[position++] & 0xff) << 16) | ((this.memory[position++] & 0xff) << 8)| ((this.memory[position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}
Program: 88280
Project: 88280
Buggy source:
@Override public int readUnsignedByte() throws IOException {
  if (position < this.end) {
    return (this.memory[position++] & 0xff);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public int readUnsignedByte() throws IOException {
  if (this.position < this.end) {
    return (this.memory[this.position++] & 0xff);
  }
 else {
    throw new EOFException();
  }
}
Program: 88281
Project: 88281
Buggy source:
@Override public int readUnsignedShort() throws IOException {
  if (position + 1 < this.end) {
    return ((this.memory[position++] & 0xff) << 8) | ((this.memory[position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public int readUnsignedShort() throws IOException {
  if (this.position < this.end - 1) {
    return ((this.memory[this.position++] & 0xff) << 8) | ((this.memory[this.position++] & 0xff) << 0);
  }
 else {
    throw new EOFException();
  }
}
Program: 88282
Project: 88282
Buggy source:
@Override public void writeInt(int v) throws IOException {
  if (position + 3 < this.end) {
    this.memory[position++]=(byte)((v >> 24) & 0xff);
    this.memory[position++]=(byte)((v >> 16) & 0xff);
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeInt(int v) throws IOException {
  if (position < this.end - 3) {
    this.memory[position++]=(byte)((v >> 24) & 0xff);
    this.memory[position++]=(byte)((v >> 16) & 0xff);
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}
Program: 88283
Project: 88283
Buggy source:
@Override public void writeChar(int v) throws IOException {
  if (position + 1 < this.end) {
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeChar(int v) throws IOException {
  if (position < this.end - 1) {
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}
Program: 88284
Project: 88284
Buggy source:
@Override public void writeLong(long v) throws IOException {
  if (position + 7 < this.end) {
    this.memory[position++]=(byte)((v >> 56) & 0xff);
    this.memory[position++]=(byte)((v >> 48) & 0xff);
    this.memory[position++]=(byte)((v >> 40) & 0xff);
    this.memory[position++]=(byte)((v >> 32) & 0xff);
    this.memory[position++]=(byte)((v >> 24) & 0xff);
    this.memory[position++]=(byte)((v >> 16) & 0xff);
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeLong(long v) throws IOException {
  if (position < this.end - 7) {
    this.memory[position++]=(byte)((v >> 56) & 0xff);
    this.memory[position++]=(byte)((v >> 48) & 0xff);
    this.memory[position++]=(byte)((v >> 40) & 0xff);
    this.memory[position++]=(byte)((v >> 32) & 0xff);
    this.memory[position++]=(byte)((v >> 24) & 0xff);
    this.memory[position++]=(byte)((v >> 16) & 0xff);
    this.memory[position++]=(byte)((v >> 8) & 0xff);
    this.memory[position++]=(byte)((v >> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}
Program: 88285
Project: 88285
Buggy source:
@Override public int getPosition(){
  return position - this.offset;
}

Fixed version (ground truth):
@Override public int getPosition(){
  return this.position - this.offset;
}
Program: 88286
Project: 88286
Buggy source:
@Override public void writeBytes(String s) throws IOException {
  final int sLen=s.length();
  if (this.position + sLen < this.end) {
    for (int i=0; i < sLen; i++) {
      writeByte(s.charAt(i));
    }
    this.position+=sLen;
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeBytes(String s) throws IOException {
  final int sLen=s.length();
  if (this.position < this.end - sLen) {
    for (int i=0; i < sLen; i++) {
      writeByte(s.charAt(i));
    }
    this.position+=sLen;
  }
 else {
    throw new EOFException();
  }
}
Program: 88287
Project: 88287
Buggy source:
@Override public DataOutputView reset(){
  position=this.offset;
  return this;
}

Fixed version (ground truth):
@Override public DataOutputView reset(){
  this.position=this.offset;
  return this;
}
Program: 88288
Project: 88288
Buggy source:
@Override public void writeShort(int v) throws IOException {
  if (position + 1 < this.end) {
    this.memory[position++]=(byte)((v >>> 8) & 0xff);
    this.memory[position++]=(byte)((v >>> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeShort(int v) throws IOException {
  if (position < this.end - 1) {
    this.memory[position++]=(byte)((v >>> 8) & 0xff);
    this.memory[position++]=(byte)((v >>> 0) & 0xff);
  }
 else {
    throw new EOFException();
  }
}
Program: 88289
Project: 88289
Buggy source:
@Override public void writeChars(String s) throws IOException {
  if (position + 2 * s.length() < this.end) {
    int length=s.length();
    for (int i=0; i < length; i++) {
      writeChar(s.charAt(i));
    }
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeChars(String s) throws IOException {
  if (position < this.end - (2 * s.length())) {
    int length=s.length();
    for (int i=0; i < length; i++) {
      writeChar(s.charAt(i));
    }
  }
 else {
    throw new EOFException();
  }
}
Program: 88290
Project: 88290
Buggy source:
@Override public void write(byte[] b,int off,int len) throws IOException {
  if (position < this.end && position + len <= this.end && off + len <= b.length) {
    System.arraycopy(b,off,this.memory,position,len);
    position+=len;
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void write(byte[] b,int off,int len) throws IOException {
  if (this.position < this.end && this.position <= this.end - len && off <= b.length - len) {
    System.arraycopy(b,off,this.memory,position,len);
    this.position+=len;
  }
 else {
    throw new EOFException();
  }
}
Program: 88291
Project: 88291
Buggy source:
@Override public void writeBoolean(boolean v) throws IOException {
  if (position < this.end) {
    this.memory[position++]=(byte)(v ? 1 : 0);
  }
 else {
    throw new EOFException();
  }
}

Fixed version (ground truth):
@Override public void writeBoolean(boolean v) throws IOException {
  if (this.position < this.end) {
    this.memory[this.position++]=(byte)(v ? 1 : 0);
  }
 else {
    throw new EOFException();
  }
}
Program: 88292
Project: 88292
Buggy source:
@Override public RandomAccessView get(DataOutput out,int offset,int length) throws IOException {
  if (offset >= 0 && offset < this.size && length >= 0 && length < this.size) {
    out.write(this.memory,this.offset + offset,length);
    return this;
  }
 else {
    throw new IndexOutOfBoundsException();
  }
}

Fixed version (ground truth):
@Override public RandomAccessView get(DataOutput out,int offset,int length) throws IOException {
  if (offset >= 0 && offset < this.size && length >= 0 && offset + length < this.size) {
    out.write(this.memory,this.offset + offset,length);
    return this;
  }
 else {
    throw new IndexOutOfBoundsException();
  }
}
Program: 88298
Project: 88298
Buggy source:
/** 
 * Sets the shipping strategy for this connection.
 * @param strategy The shipping strategy to be applied to this connection.
 */
public void setShipStrategy(ShipStrategy strategy){
  if (strategy == ShipStrategy.FORWARD && sourcePact.getDegreeOfParallelism() < targetPact.getDegreeOfParallelism()) {
    for (    InterestingProperties props : this.interestingProps) {
      PartitionProperty pp=props.getGlobalProperties().getPartitioning();
      if (pp == PartitionProperty.HASH_PARTITIONED || pp == PartitionProperty.ANY) {
        strategy=ShipStrategy.PARTITION_LOCAL_HASH;
        break;
      }
 else       if (pp == PartitionProperty.RANGE_PARTITIONED) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
    }
  }
  this.shipStrategy=strategy;
}

Fixed version (ground truth):
/** 
 * Sets the shipping strategy for this connection.
 * @param strategy The shipping strategy to be applied to this connection.
 */
public void setShipStrategy(ShipStrategy strategy){
  if (strategy == ShipStrategy.FORWARD && sourcePact.getDegreeOfParallelism() < targetPact.getDegreeOfParallelism()) {
    if (this.interestingProps != null) {
      for (      InterestingProperties props : this.interestingProps) {
        PartitionProperty pp=props.getGlobalProperties().getPartitioning();
        if (pp == PartitionProperty.HASH_PARTITIONED || pp == PartitionProperty.ANY) {
          strategy=ShipStrategy.PARTITION_LOCAL_HASH;
          break;
        }
 else         if (pp == PartitionProperty.RANGE_PARTITIONED) {
          throw new CompilerException("String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
  this.shipStrategy=strategy;
}
Program: 88303
Project: 88303
Buggy source:
@Test public void testJob() throws Exception {
  preSubmit();
  JobGraph jobGraph=getJobGraph();
  cluster.submitJobAndWait(jobGraph,getJarFilePath());
  postSubmit();
}

Fixed version (ground truth):
@Test public void testJob() throws Exception {
  preSubmit();
  JobGraph jobGraph=null;
  try {
    jobGraph=getJobGraph();
  }
 catch (  Exception e) {
    LOG.error(e);
    Assert.fail("String_Node_Str");
  }
  try {
    cluster.submitJobAndWait(jobGraph,getJarFilePath());
  }
 catch (  Exception e) {
    LOG.error(e);
    Assert.fail("String_Node_Str");
  }
  postSubmit();
}
Program: 88304
Project: 88304
Buggy source:
@Override public boolean equals(Object o){
  return (o.getClass() == PactNull.class);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  return (o != null && o.getClass() == PactNull.class);
}
Program: 88312
Project: 88312
Buggy source:
/** 
 * Copy constructor to create a copy of the data-source object for the process of plan enumeration.
 * @param template The node to create a copy of.
 * @param gp The global properties of this copy.
 * @param lp The local properties of this copy.
 */
protected DataSourceNode(DataSourceNode template,GlobalProperties gp,LocalProperties lp){
  super(template,gp,lp);
}

Fixed version (ground truth):
/** 
 * Copy constructor to create a copy of the data-source object for the process of plan enumeration.
 * @param template The node to create a copy of.
 * @param gp The global properties of this copy.
 * @param lp The local properties of this copy.
 */
protected DataSourceNode(DataSourceNode template,GlobalProperties gp,LocalProperties lp){
  super(template,gp,lp);
  this.fileSize=template.fileSize;
}
Program: 88313
Project: 88313
Buggy source:
@Override public List<MapNode> getAlternativePlans(CostEstimator estimator){
  if (cachedPlans != null) {
    return cachedPlans;
  }
  List<? extends OptimizerNode> inPlans=input.getSourcePact().getAlternativePlans(estimator);
  List<MapNode> outputPlans=new ArrayList<MapNode>();
  for (  OptimizerNode pred : inPlans) {
    ShipStrategy ss=input.getShipStrategy() == ShipStrategy.NONE ? ShipStrategy.FORWARD : input.getShipStrategy();
    GlobalProperties gp=PactConnection.getGlobalPropertiesAfterConnection(pred,ss);
    LocalProperties lp=PactConnection.getLocalPropertiesAfterConnection(pred,ss);
    MapNode nMap=new MapNode(this,pred,input,gp,lp);
    nMap.input.setShipStrategy(ss);
    nMap.getGlobalProperties().getPreservedAfterContract(getOutputContract());
    nMap.getLocalProperties().getPreservedAfterContract(getOutputContract());
    estimator.costOperator(nMap);
    outputPlans.add(nMap);
  }
  prunePlanAlternatives(outputPlans);
  if (this.getOutgoingConnections() != null && this.getOutgoingConnections().size() > 1) {
    this.cachedPlans=outputPlans;
  }
  return outputPlans;
}

Fixed version (ground truth):
@Override public List<MapNode> getAlternativePlans(CostEstimator estimator){
  if (cachedPlans != null) {
    return cachedPlans;
  }
  List<? extends OptimizerNode> inPlans=input.getSourcePact().getAlternativePlans(estimator);
  List<MapNode> outputPlans=new ArrayList<MapNode>();
  for (  OptimizerNode pred : inPlans) {
    ShipStrategy ss=input.getShipStrategy() == ShipStrategy.NONE ? ShipStrategy.FORWARD : input.getShipStrategy();
    GlobalProperties gp=PactConnection.getGlobalPropertiesAfterConnection(pred,this,ss);
    LocalProperties lp=PactConnection.getLocalPropertiesAfterConnection(pred,this,ss);
    MapNode nMap=new MapNode(this,pred,input,gp,lp);
    nMap.input.setShipStrategy(ss);
    nMap.getGlobalProperties().getPreservedAfterContract(getOutputContract());
    nMap.getLocalProperties().getPreservedAfterContract(getOutputContract());
    estimator.costOperator(nMap);
    outputPlans.add(nMap);
  }
  prunePlanAlternatives(outputPlans);
  if (this.getOutgoingConnections() != null && this.getOutgoingConnections().size() > 1) {
    this.cachedPlans=outputPlans;
  }
  return outputPlans;
}
Program: 88316
Project: 88316
Buggy source:
public void read() throws IOException, EOFException {
  if (!isActiveConnection()) {
    System.out.println("String_Node_Str");
    return;
  }
  this.deserializer.read(this.readableByteChannel);
  final TransferEnvelope transferEnvelope=this.deserializer.getFullyDeserializedTransferEnvelope();
  if (transferEnvelope != null) {
    this.byteBufferedChannelManager.queueIncomingTransferEnvelope(transferEnvelope);
  }
}

Fixed version (ground truth):
public void read() throws IOException, EOFException {
  if (this.inactiveConnection) {
    final ByteBuffer buf=ByteBuffer.allocate(8);
    final int bytesRead=this.readableByteChannel.read(buf);
    if (bytesRead == 0) {
      return;
    }
 else     if (bytesRead == -1) {
      throw new EOFException();
    }
 else {
      throw new IOException("String_Node_Str" + bytesRead + "String_Node_Str");
    }
  }
  this.deserializer.read(this.readableByteChannel);
  final TransferEnvelope transferEnvelope=this.deserializer.getFullyDeserializedTransferEnvelope();
  if (transferEnvelope != null) {
    this.byteBufferedChannelManager.queueIncomingTransferEnvelope(transferEnvelope);
  }
}
Program: 88317
Project: 88317
Buggy source:
public void reportTransmissionProblem(SelectionKey key,IOException ioe){
  if (!this.readsFromCheckpoint) {
    final SocketChannel socketChannel=(SocketChannel)this.readableByteChannel;
    LOG.error("String_Node_Str" + socketChannel.socket().getRemoteSocketAddress() + "String_Node_Str");
  }
  LOG.error(ioe);
  try {
    this.readableByteChannel.close();
  }
 catch (  IOException e) {
    LOG.debug("String_Node_Str");
  }
  if (key != null) {
    key.cancel();
  }
  if (this.deserializer.getBuffer() != null) {
    this.deserializer.getBuffer().recycleBuffer();
  }
  this.deserializer.reset();
  this.byteBufferedChannelManager.unregisterIncomingConnection(this.incomingConnectionID,this.readableByteChannel);
}

Fixed version (ground truth):
public void reportTransmissionProblem(SelectionKey key,IOException ioe){
  if (!this.readsFromCheckpoint) {
    final SocketChannel socketChannel=(SocketChannel)this.readableByteChannel;
    LOG.error("String_Node_Str" + socketChannel.socket().getRemoteSocketAddress() + "String_Node_Str");
  }
  LOG.error(ioe);
  try {
    this.readableByteChannel.close();
  }
 catch (  IOException e) {
    LOG.debug("String_Node_Str");
  }
  if (key != null) {
    key.cancel();
  }
  if (this.deserializer.getBuffer() != null) {
    this.deserializer.getBuffer().recycleBuffer();
  }
  this.deserializer.reset();
  if (!this.inactiveConnection) {
    this.byteBufferedChannelManager.unregisterIncomingConnection(this.incomingConnectionID,this.readableByteChannel);
  }
}
Program: 88318
Project: 88318
Buggy source:
public void closeConnection(SelectionKey key){
  try {
    this.readableByteChannel.close();
  }
 catch (  IOException ioe) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(ioe));
  }
  if (key != null) {
    key.cancel();
  }
  this.byteBufferedChannelManager.unregisterIncomingConnection(this.incomingConnectionID,this.readableByteChannel);
}

Fixed version (ground truth):
public void closeConnection(SelectionKey key){
  try {
    this.readableByteChannel.close();
  }
 catch (  IOException ioe) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(ioe));
  }
  if (key != null) {
    key.cancel();
  }
  if (!this.inactiveConnection) {
    this.byteBufferedChannelManager.unregisterIncomingConnection(this.incomingConnectionID,this.readableByteChannel);
  }
}
Program: 88319
Project: 88319
Buggy source:
/** 
 * Sets the shipping strategy for this connection.
 * @param strategy The shipping strategy to be applied to this connection.
 */
public void setShipStrategy(ShipStrategy strategy){
  if (strategy == ShipStrategy.FORWARD && sourcePact.getDegreeOfParallelism() < targetPact.getDegreeOfParallelism()) {
    for (    InterestingProperties props : this.interestingProps) {
      PartitionProperty pp=props.getGlobalProperties().getPartitioning();
      if (pp == PartitionProperty.HASH_PARTITIONED || pp == PartitionProperty.ANY) {
        strategy=ShipStrategy.PARTITION_LOCAL_HASH;
        break;
      }
 else       if (pp == PartitionProperty.RANGE_PARTITIONED) {
        throw new CompilerException("String_Node_Str" + "String_Node_Str");
      }
    }
  }
  this.shipStrategy=strategy;
}

Fixed version (ground truth):
/** 
 * Sets the shipping strategy for this connection.
 * @param strategy The shipping strategy to be applied to this connection.
 */
public void setShipStrategy(ShipStrategy strategy){
  if (strategy == ShipStrategy.FORWARD && sourcePact.getDegreeOfParallelism() < targetPact.getDegreeOfParallelism()) {
    if (this.interestingProps != null) {
      for (      InterestingProperties props : this.interestingProps) {
        PartitionProperty pp=props.getGlobalProperties().getPartitioning();
        if (pp == PartitionProperty.HASH_PARTITIONED || pp == PartitionProperty.ANY) {
          strategy=ShipStrategy.PARTITION_LOCAL_HASH;
          break;
        }
 else         if (pp == PartitionProperty.RANGE_PARTITIONED) {
          throw new CompilerException("String_Node_Str" + "String_Node_Str");
        }
      }
    }
  }
  this.shipStrategy=strategy;
}
Program: 88321
Project: 88321
Buggy source:
/** 
 * Requests all output gates to be closed.
 */
private void requestAllOutputGatesToClose() throws IOException {
  for (int i=0; i < getNumberOfOutputGates(); i++) {
    this.getOutputGate(i).requestClose();
  }
}

Fixed version (ground truth):
/** 
 * Requests all output gates to be closed.
 */
private void requestAllOutputGatesToClose() throws IOException, InterruptedException {
  for (int i=0; i < getNumberOfOutputGates(); i++) {
    this.getOutputGate(i).requestClose();
  }
}
Program: 88322
Project: 88322
Buggy source:
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 */
public void publishEvent(AbstractTaskEvent event) throws IOException {
  Iterator<AbstractInputChannel<T>> it=this.inputChannels.iterator();
  while (it.hasNext()) {
    it.next().transferEvent(event);
  }
}

Fixed version (ground truth):
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 * @throws InterruptedException thrown if the thread is interrupted while waiting for the event to be published
 */
public void publishEvent(AbstractTaskEvent event) throws IOException, InterruptedException {
  Iterator<AbstractInputChannel<T>> it=this.inputChannels.iterator();
  while (it.hasNext()) {
    it.next().transferEvent(event);
  }
}
Program: 88323
Project: 88323
Buggy source:
/** 
 * Requests the output gate to closed. This means the application will send no records through this gate anymore.
 */
public void requestClose() throws IOException {
  for (int i=0; i < this.getNumberOfOutputChannels(); i++) {
    final AbstractOutputChannel<T> outputChannel=this.getOutputChannel(i);
    outputChannel.requestClose();
  }
}

Fixed version (ground truth):
/** 
 * Requests the output gate to closed. This means the application will send no records through this gate anymore.
 */
public void requestClose() throws IOException, InterruptedException {
  for (int i=0; i < this.getNumberOfOutputChannels(); i++) {
    final AbstractOutputChannel<T> outputChannel=this.getOutputChannel(i);
    outputChannel.requestClose();
  }
}
Program: 88324
Project: 88324
Buggy source:
public void flush() throws IOException {
  final Iterator<AbstractOutputChannel<T>> it=this.outputChannels.iterator();
  while (it.hasNext()) {
    it.next().flush();
  }
}

Fixed version (ground truth):
public void flush() throws IOException, InterruptedException {
  final Iterator<AbstractOutputChannel<T>> it=this.outputChannels.iterator();
  while (it.hasNext()) {
    it.next().flush();
  }
}
Program: 88325
Project: 88325
Buggy source:
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 */
public void publishEvent(AbstractTaskEvent event) throws IOException {
  final Iterator<AbstractOutputChannel<T>> it=this.outputChannels.iterator();
  while (it.hasNext()) {
    it.next().transferEvent(event);
  }
}

Fixed version (ground truth):
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 * @throws InterruptedException thrown if the thread is interrupted while waiting for the event to be published
 */
public void publishEvent(AbstractTaskEvent event) throws IOException, InterruptedException {
  final Iterator<AbstractOutputChannel<T>> it=this.outputChannels.iterator();
  while (it.hasNext()) {
    it.next().transferEvent(event);
  }
}
Program: 88326
Project: 88326
Buggy source:
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 */
public void publishEvent(AbstractTaskEvent event) throws IOException {
  this.inputGate.publishEvent(event);
}

Fixed version (ground truth):
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 * @throws InterruptedException thrown if the thread is interrupted while waiting for the event to be published
 */
public void publishEvent(AbstractTaskEvent event) throws IOException, InterruptedException {
  this.inputGate.publishEvent(event);
}
Program: 88327
Project: 88327
Buggy source:
public void flush() throws IOException {
  this.outputGate.flush();
}

Fixed version (ground truth):
public void flush() throws IOException, InterruptedException {
  this.outputGate.flush();
}
Program: 88328
Project: 88328
Buggy source:
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 */
public void publishEvent(AbstractTaskEvent event) throws IOException {
  this.outputGate.publishEvent(event);
}

Fixed version (ground truth):
/** 
 * Publishes an event.
 * @param event the event to be published
 * @throws IOException thrown if an error occurs while transmitting the event
 * @throws InterruptedException thrown if the thread is interrupted while waiting for the event to be published
 */
public void publishEvent(AbstractTaskEvent event) throws IOException, InterruptedException {
  this.outputGate.publishEvent(event);
}
Program: 88329
Project: 88329
Buggy source:
/** 
 * Connects a record writer to an output gate.
 * @param outputClass the class of the record that can be emitted with this record writer
 */
@SuppressWarnings("String_Node_Str") private void connectOutputGate(Class<T> outputClass,ChannelSelector selector){
  if (this.environment.hasUnboundOutputGates()) {
    final OutputGate<T> eog=(OutputGate<T>)this.environment.getUnboundOutputGate(0);
    if (!outputClass.equals(eog.getType())) {
      throw new RuntimeException("String_Node_Str");
    }
    this.outputGate=eog;
  }
 else {
    this.outputGate=new OutputGate<T>(outputClass,this.environment.getNumberOfOutputGates(),selector);
    this.environment.registerOutputGate(this.outputGate);
  }
}

Fixed version (ground truth):
/** 
 * Connects a record writer to an output gate.
 * @param outputClass the class of the record that can be emitted with this record writer
 */
@SuppressWarnings("String_Node_Str") private void connectOutputGate(Class<T> outputClass,ChannelSelector<T> selector){
  if (this.environment.hasUnboundOutputGates()) {
    final OutputGate<T> eog=(OutputGate<T>)this.environment.getUnboundOutputGate(0);
    if (!outputClass.equals(eog.getType())) {
      throw new RuntimeException("String_Node_Str");
    }
    this.outputGate=eog;
  }
 else {
    this.outputGate=new OutputGate<T>(outputClass,this.environment.getNumberOfOutputGates(),selector);
    this.environment.registerOutputGate(this.outputGate);
  }
}
Program: 88330
Project: 88330
Buggy source:
public abstract void transferEvent(AbstractEvent event) throws IOException ;

Fixed version (ground truth):
public abstract void transferEvent(AbstractEvent event) throws IOException, InterruptedException ;
Program: 88331
Project: 88331
Buggy source:
public abstract void flush() throws IOException ;

Fixed version (ground truth):
public abstract void flush() throws IOException, InterruptedException ;
Program: 88332
Project: 88332
Buggy source:
/** 
 * Requests the output channel to close. After calling this method no more records can be written to the channel. The channel is finally closed when all remaining data that may exist in internal buffers are written to the channel.
 */
public abstract void requestClose() throws IOException ;

Fixed version (ground truth):
/** 
 * Requests the output channel to close. After calling this method no more records can be written to the channel. The channel is finally closed when all remaining data that may exist in internal buffers are written to the channel.
 * @throws IOException thrown if an I/O error occurs while requesting the channel to close
 * @throws InterruptedException thrown if the thread is interrupted while requesting the channel to close
 */
public abstract void requestClose() throws IOException, InterruptedException ;
Program: 88333
Project: 88333
Buggy source:
@SuppressWarnings("String_Node_Str") private AbstractDirectInputChannel<T> getConnectedInputChannel() throws IOException {
  AbstractDirectInputChannel<T> directInputChannel=null;
  if (this.directChannelBroker == null) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < this.numberOfConnectionRetries; i++) {
    directInputChannel=(AbstractDirectInputChannel<T>)this.directChannelBroker.getDirectInputChannelByID(getConnectedChannelID());
    if (directInputChannel != null) {
      return directInputChannel;
    }
    try {
      Thread.sleep(CONNECTION_SLEEP_INTERVAL);
    }
 catch (    InterruptedException e) {
      LOG.error(e);
    }
  }
  throw new IOException("String_Node_Str" + getID());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private AbstractDirectInputChannel<T> getConnectedInputChannel() throws IOException, InterruptedException {
  AbstractDirectInputChannel<T> directInputChannel=null;
  if (this.directChannelBroker == null) {
    throw new IOException("String_Node_Str");
  }
  for (int i=0; i < this.numberOfConnectionRetries; i++) {
    directInputChannel=(AbstractDirectInputChannel<T>)this.directChannelBroker.getDirectInputChannelByID(getConnectedChannelID());
    if (directInputChannel != null) {
      return directInputChannel;
    }
    Thread.sleep(CONNECTION_SLEEP_INTERVAL);
  }
  throw new IOException("String_Node_Str" + getID());
}
Program: 88334
Project: 88334
Buggy source:
@Override public void flush() throws IOException {
  if (this.connectedDirectInputChannel == null) {
    this.connectedDirectInputChannel=getConnectedInputChannel();
  }
  this.connectedDirectInputChannel.requestFlush();
}

Fixed version (ground truth):
@Override public void flush() throws IOException, InterruptedException {
  if (this.connectedDirectInputChannel == null) {
    this.connectedDirectInputChannel=getConnectedInputChannel();
  }
  this.connectedDirectInputChannel.requestFlush();
}
Program: 88335
Project: 88335
Buggy source:
@Override public void transferEvent(AbstractEvent event) throws IOException {
  if (this.connectedDirectInputChannel == null) {
    this.connectedDirectInputChannel=getConnectedInputChannel();
  }
  this.connectedDirectInputChannel.processEvent(event);
}

Fixed version (ground truth):
@Override public void transferEvent(AbstractEvent event) throws IOException, InterruptedException {
  if (this.connectedDirectInputChannel == null) {
    this.connectedDirectInputChannel=getConnectedInputChannel();
  }
  this.connectedDirectInputChannel.processEvent(event);
}
Program: 88336
Project: 88336
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void requestClose(){
  this.closeRequested=true;
  if (this.connectedDirectInputChannel == null) {
    try {
      this.connectedDirectInputChannel=getConnectedInputChannel();
    }
 catch (    IOException e) {
      this.connectionFailureException=e;
      return;
    }
  }
  this.connectedDirectInputChannel.requestClose();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void requestClose() throws InterruptedException {
  this.closeRequested=true;
  if (this.connectedDirectInputChannel == null) {
    try {
      this.connectedDirectInputChannel=getConnectedInputChannel();
    }
 catch (    IOException e) {
      this.connectionFailureException=e;
      return;
    }
  }
  this.connectedDirectInputChannel.requestClose();
}
Program: 88337
Project: 88337
Buggy source:
/** 
 * This test checks the correct registration/deregistration of   {@link AbstractDirectInputChannel} and{@link AbstractDirectOutputChannel} objects.
 */
@Test public void testDirectChannelManager(){
  final DirectChannelManager dcm=new DirectChannelManager();
  when(this.deserializer.getRecordType()).thenReturn(StringRecord.class);
  final InMemoryInputChannel<StringRecord> inputChannel=new InMemoryInputChannel<StringRecord>(this.inputGate,0,this.deserializer,this.inputChannelID,CompressionLevel.NO_COMPRESSION);
  final InMemoryOutputChannel<StringRecord> outputChannel=new InMemoryOutputChannel<StringRecord>(this.outputGate,0,this.outputChannelID,CompressionLevel.NO_COMPRESSION);
  inputChannel.setConnectedChannelID(this.outputChannelID);
  outputChannel.setConnectedChannelID(this.inputChannelID);
  dcm.registerDirectInputChannel(inputChannel);
  dcm.registerDirectOutputChannel(outputChannel);
  try {
    outputChannel.transferEvent(new StringTaskEvent("String_Node_Str"));
  }
 catch (  IOException ioe) {
    fail(ioe.getMessage());
  }
  assertEquals(inputChannel,dcm.getDirectInputChannelByID(this.inputChannelID));
  assertEquals(outputChannel,dcm.getDirectOutputChannelByID(this.outputChannelID));
  dcm.unregisterDirectInputChannel(inputChannel);
  dcm.unregisterDirectOutputChannel(outputChannel);
  assertEquals(null,dcm.getDirectInputChannelByID(this.inputChannelID));
  assertEquals(null,dcm.getDirectOutputChannelByID(this.outputChannelID));
}

Fixed version (ground truth):
/** 
 * This test checks the correct registration/deregistration of   {@link AbstractDirectInputChannel} and{@link AbstractDirectOutputChannel} objects.
 */
@Test public void testDirectChannelManager(){
  final DirectChannelManager dcm=new DirectChannelManager();
  when(this.deserializer.getRecordType()).thenReturn(StringRecord.class);
  final InMemoryInputChannel<StringRecord> inputChannel=new InMemoryInputChannel<StringRecord>(this.inputGate,0,this.deserializer,this.inputChannelID,CompressionLevel.NO_COMPRESSION);
  final InMemoryOutputChannel<StringRecord> outputChannel=new InMemoryOutputChannel<StringRecord>(this.outputGate,0,this.outputChannelID,CompressionLevel.NO_COMPRESSION);
  inputChannel.setConnectedChannelID(this.outputChannelID);
  outputChannel.setConnectedChannelID(this.inputChannelID);
  dcm.registerDirectInputChannel(inputChannel);
  dcm.registerDirectOutputChannel(outputChannel);
  try {
    outputChannel.transferEvent(new StringTaskEvent("String_Node_Str"));
  }
 catch (  IOException ioe) {
    fail(ioe.getMessage());
  }
catch (  InterruptedException ie) {
    fail(ie.getMessage());
  }
  assertEquals(inputChannel,dcm.getDirectInputChannelByID(this.inputChannelID));
  assertEquals(outputChannel,dcm.getDirectOutputChannelByID(this.outputChannelID));
  dcm.unregisterDirectInputChannel(inputChannel);
  dcm.unregisterDirectOutputChannel(outputChannel);
  assertEquals(null,dcm.getDirectInputChannelByID(this.inputChannelID));
  assertEquals(null,dcm.getDirectOutputChannelByID(this.outputChannelID));
}
Program: 88338
Project: 88338
Buggy source:
/** 
 * Blocks until all output channels are closed.
 * @throws IOException thrown if an error occurred while closing the output channels
 */
private void waitForOutputChannelsToBeClosed() throws IOException {
  while (true) {
    boolean allClosed=true;
    for (int i=0; i < getNumberOfOutputGates(); i++) {
      final OutputGate<? extends Record> eog=getOutputGate(i);
      if (!eog.isClosed()) {
        allClosed=false;
      }
    }
    if (allClosed) {
      break;
    }
 else {
      try {
        Thread.sleep(SLEEPINTERVAL);
      }
 catch (      InterruptedException e) {
        LOG.debug(e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Blocks until all output channels are closed.
 * @throws IOException thrown if an error occurred while closing the output channels
 * @throws InterruptedException thrown if the thread waiting for the channels to be closed is interrupted
 */
private void waitForOutputChannelsToBeClosed() throws IOException, InterruptedException {
  while (true) {
    if (this.isCanceled) {
      throw new InterruptedException();
    }
    boolean allClosed=true;
    for (int i=0; i < getNumberOfOutputGates(); i++) {
      final OutputGate<? extends Record> eog=getOutputGate(i);
      if (!eog.isClosed()) {
        allClosed=false;
      }
    }
    if (allClosed) {
      break;
    }
 else {
      Thread.sleep(SLEEPINTERVAL);
    }
  }
}
Program: 88339
Project: 88339
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  if (invokable == null) {
    LOG.fatal("String_Node_Str");
  }
  changeExecutionState(ExecutionState.RUNNING,null);
  try {
    this.invokable.invoke();
    if (this.isCanceled) {
      throw new InterruptedException();
    }
  }
 catch (  Exception e) {
    if (!this.isCanceled) {
      try {
        this.invokable.cancel();
      }
 catch (      Exception e2) {
        LOG.error(StringUtils.stringifyException(e2));
      }
    }
    if (this.isCanceled) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHING,null);
  try {
    closeInputGates();
    requestAllOutputGatesToClose();
    waitForInputChannelsToBeClosed();
    waitForOutputChannelsToBeClosed();
  }
 catch (  Exception e) {
    changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    return;
  }
  changeExecutionState(ExecutionState.FINISHED,null);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  if (invokable == null) {
    LOG.fatal("String_Node_Str");
  }
  changeExecutionState(ExecutionState.RUNNING,null);
  try {
    this.invokable.invoke();
    if (this.isCanceled) {
      throw new InterruptedException();
    }
  }
 catch (  Exception e) {
    if (!this.isCanceled) {
      try {
        this.invokable.cancel();
      }
 catch (      Exception e2) {
        LOG.error(StringUtils.stringifyException(e2));
      }
    }
    if (this.isCanceled) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHING,null);
  try {
    closeInputGates();
    requestAllOutputGatesToClose();
    waitForInputChannelsToBeClosed();
    waitForOutputChannelsToBeClosed();
  }
 catch (  Exception e) {
    if (this.isCanceled) {
      changeExecutionState(ExecutionState.CANCELED,null);
    }
 else {
      changeExecutionState(ExecutionState.FAILED,StringUtils.stringifyException(e));
    }
    return;
  }
  changeExecutionState(ExecutionState.FINISHED,null);
}
Program: 88340
Project: 88340
Buggy source:
/** 
 * Blocks until all input channels are closed.
 * @throws IOException thrown if an error occurred while closing the input channels
 */
private void waitForInputChannelsToBeClosed() throws IOException {
  while (true) {
    boolean allClosed=true;
    for (int i=0; i < getNumberOfInputGates(); i++) {
      final InputGate<? extends Record> eig=getInputGate(i);
      if (!eig.isClosed()) {
        allClosed=false;
      }
    }
    if (allClosed) {
      break;
    }
 else {
      try {
        Thread.sleep(SLEEPINTERVAL);
      }
 catch (      InterruptedException e) {
        LOG.debug(e);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Blocks until all input channels are closed.
 * @throws IOException thrown if an error occurred while closing the input channels
 * @throws InterruptedException thrown if the thread waiting for the channels to be closed is interrupted
 */
private void waitForInputChannelsToBeClosed() throws IOException, InterruptedException {
  while (true) {
    if (this.isCanceled) {
      throw new InterruptedException();
    }
    boolean allClosed=true;
    for (int i=0; i < getNumberOfInputGates(); i++) {
      final InputGate<? extends Record> eig=getInputGate(i);
      if (!eig.isClosed()) {
        allClosed=false;
      }
    }
    if (allClosed) {
      break;
    }
 else {
      Thread.sleep(SLEEPINTERVAL);
    }
  }
}
Program: 88342
Project: 88342
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (this.inetAddress != null) {
    return this.inetAddress.equals(obj);
  }
 else {
    return this.fileName.equals(obj);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (!(obj instanceof IncomingConnectionID)) {
    return false;
  }
  final IncomingConnectionID ici=(IncomingConnectionID)obj;
  if (this.inetAddress != null) {
    return this.inetAddress.equals(ici.inetAddress);
  }
 else {
    return this.fileName.equals(ici.fileName);
  }
}
Program: 88343
Project: 88343
Buggy source:
private void doWrite(SelectionKey key){
  final SocketChannel socketChannel=(SocketChannel)key.channel();
  final OutgoingConnection outgoingConnection=(OutgoingConnection)key.attachment();
  try {
    if (!outgoingConnection.write(socketChannel)) {
      outgoingConnection.closeConnection(socketChannel,key);
    }
  }
 catch (  IOException ioe) {
    outgoingConnection.reportTransmissionProblem(socketChannel,key,ioe);
  }
}

Fixed version (ground truth):
private void doWrite(SelectionKey key){
  final SocketChannel socketChannel=(SocketChannel)key.channel();
  final OutgoingConnection outgoingConnection=(OutgoingConnection)key.attachment();
  try {
    if (!outgoingConnection.write(socketChannel)) {
    }
  }
 catch (  IOException ioe) {
    outgoingConnection.reportTransmissionProblem(socketChannel,key,ioe);
  }
}
Program: 88345
Project: 88345
Buggy source:
/** 
 * Creates a new channel to the path indicated by the given ID. The channel hands IO requests to the given request queue to be processed.
 * @param channelID The id describing the path of the file that the channel accessed.
 * @param requestQueue The queue that this channel hands its IO requests to.
 */
protected ChannelAccess(Channel.ID channelID,RequestQueue<IORequest<T>> requestQueue,Collection<T> buffers) throws IOException {
  if (channelID == null || requestQueue == null) {
    throw new NullPointerException();
  }
  this.id=channelID;
  this.numBuffers=buffers.size();
  this.requestQueue=requestQueue;
  this.returnBuffers=new ArrayBlockingQueue<T>(buffers.size(),false);
  try {
    RandomAccessFile file=new RandomAccessFile(id.getPath(),"String_Node_Str");
    this.fileChannel=file.getChannel();
  }
 catch (  IOException e) {
    throw new IOException("String_Node_Str" + channelID.getPath() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Creates a new channel to the path indicated by the given ID. The channel hands IO requests to the given request queue to be processed.
 * @param channelID The id describing the path of the file that the channel accessed.
 * @param requestQueue The queue that this channel hands its IO requests to.
 */
protected ChannelAccess(Channel.ID channelID,RequestQueue<IORequest<T>> requestQueue,Collection<T> buffers) throws IOException {
  if (channelID == null || requestQueue == null || buffers == null) {
    throw new IllegalArgumentException();
  }
  if (buffers.isEmpty()) {
    throw new IllegalArgumentException();
  }
  this.id=channelID;
  this.numBuffers=buffers.size();
  this.requestQueue=requestQueue;
  this.returnBuffers=new ArrayBlockingQueue<T>(buffers.size(),false);
  try {
    RandomAccessFile file=new RandomAccessFile(id.getPath(),"String_Node_Str");
    this.fileChannel=file.getChannel();
  }
 catch (  IOException e) {
    throw new IOException("String_Node_Str" + channelID.getPath() + "String_Node_Str",e);
  }
}
Program: 88346
Project: 88346
Buggy source:
/** 
 * @param channelID
 * @param requestQueue
 * @param buffers
 * @param deleteWhenDone
 * @throws IOException
 */
public ChannelReader(Channel.ID channelID,RequestQueue<IORequest<Buffer.Input>> requestQueue,Collection<Buffer.Input> buffers,boolean deleteWhenDone) throws IOException {
  super(channelID,requestQueue,buffers);
  this.deleteWhenDone=deleteWhenDone;
  for (  Buffer.Input buffer : buffers) {
    this.requestQueue.add(new IORequest<Buffer.Input>(this,buffer));
  }
}

Fixed version (ground truth):
/** 
 * @param channelID
 * @param requestQueue
 * @param buffers
 * @param deleteWhenDone
 * @throws IOException
 */
protected ChannelReader(Channel.ID channelID,RequestQueue<IORequest<Buffer.Input>> requestQueue,Collection<Buffer.Input> buffers,boolean deleteWhenDone) throws IOException {
  super(channelID,requestQueue,buffers);
  this.deleteWhenDone=deleteWhenDone;
  for (  Buffer.Input buffer : buffers) {
    this.requestQueue.add(new IORequest<Buffer.Input>(this,buffer));
  }
}