nus-yam/ex-repair huggingface dataset:
Program: 112098
Project: 112098
Buggy source:
public MemColumnWriter(ColumnDescriptor path,PageWriter pageWriter,int pageSizeThreshold){
  this.path=path;
  this.pageWriter=pageWriter;
  this.pageSizeThreshold=pageSizeThreshold;
  repetitionLevelColumn=new BitPackingColumnWriter(path.getMaxRepetitionLevel());
  definitionLevelColumn=BoundedColumnFactory.getBoundedWriter(path.getMaxDefinitionLevel());
switch (path.getType()) {
case BOOLEAN:
    this.dataColumn=new BooleanPlainColumnWriter(pageSizeThreshold * 11 / 10);
default :
  this.dataColumn=new PlainColumnWriter(pageSizeThreshold * 11 / 10);
}
}

Fixed version (ground truth):
public MemColumnWriter(ColumnDescriptor path,PageWriter pageWriter,int pageSizeThreshold){
  this.path=path;
  this.pageWriter=pageWriter;
  this.pageSizeThreshold=pageSizeThreshold;
  repetitionLevelColumn=new BitPackingColumnWriter(path.getMaxRepetitionLevel());
  definitionLevelColumn=BoundedColumnFactory.getBoundedWriter(path.getMaxDefinitionLevel());
switch (path.getType()) {
case BOOLEAN:
    this.dataColumn=new BooleanPlainColumnWriter(pageSizeThreshold * 11 / 10);
  break;
default :
this.dataColumn=new PlainColumnWriter(pageSizeThreshold * 11 / 10);
}
}
Program: 112099
Project: 112099
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeByte(int value){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeByte(int value){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112100
Project: 112100
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeLong(long v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeLong(long v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112101
Project: 112101
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeBytes(Binary v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeBytes(Binary v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112102
Project: 112102
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeFloat(float v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeFloat(float v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112103
Project: 112103
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeBoolean(boolean v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeBoolean(boolean v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112104
Project: 112104
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeInteger(int v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeInteger(int v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112105
Project: 112105
Buggy source:
/** 
 * @param value the value to encode
 */
public void writeDouble(double v){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @param value the value to encode
 */
public void writeDouble(double v){
  throw new UnsupportedOperationException(getClass().getName());
}
Program: 112106
Project: 112106
Buggy source:
public static Binary fromByteArray(final byte[] value){
  return new Binary(){
    @Override public String toStringUsingUTF8(){
      return new String(value,BytesUtils.UTF8);
    }
    @Override public int length(){
      return value.length;
    }
    @Override public void writeTo(    OutputStream out) throws IOException {
      out.write(value);
    }
    @Override public byte[] getBytes(){
      return value;
    }
    @Override public int hashCode(){
      return Binary.hashCode(value,0,value.length);
    }
    @Override boolean equals(    Binary other){
      return other.equals(value,0,value.length);
    }
    @Override boolean equals(    byte[] other,    int otherOffset,    int otherLength){
      return equals(value,0,value.length,other,otherOffset,otherLength);
    }
  }
;
}

Fixed version (ground truth):
public static Binary fromByteArray(final byte[] value){
  return new Binary(){
    @Override public String toStringUsingUTF8(){
      return new String(value,BytesUtils.UTF8);
    }
    @Override public int length(){
      return value.length;
    }
    @Override public void writeTo(    OutputStream out) throws IOException {
      out.write(value);
    }
    @Override public byte[] getBytes(){
      return value;
    }
    @Override public int hashCode(){
      return Binary.hashCode(value,0,value.length);
    }
    @Override boolean equals(    Binary other){
      return other.equals(value,0,value.length);
    }
    @Override boolean equals(    byte[] other,    int otherOffset,    int otherLength){
      return equals(value,0,value.length,other,otherOffset,otherLength);
    }
    @Override public ByteBuffer toByteBuffer(){
      return ByteBuffer.wrap(value);
    }
  }
;
}
Program: 112107
Project: 112107
Buggy source:
private void readOneValue(TProtocol in,TProtocol out,byte type) throws TException {
switch (type) {
case TType.LIST:
    readOneList(in,out);
  break;
case TType.MAP:
readOneMap(in,out);
break;
case TType.SET:
readOneSet(in,out);
break;
case TType.STRUCT:
readOneStruct(in,out);
break;
case TType.STOP:
break;
case TType.BOOL:
out.writeBool(in.readBool());
break;
case TType.BYTE:
out.writeBool(in.readBool());
break;
case TType.DOUBLE:
out.writeBool(in.readBool());
break;
case TType.I16:
out.writeI16(in.readI16());
break;
case TType.ENUM:
case TType.I32:
out.writeI32(in.readI32());
break;
case TType.I64:
out.writeI64(in.readI64());
break;
case TType.STRING:
out.writeString(in.readString());
break;
case TType.VOID:
break;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
private void readOneValue(TProtocol in,TProtocol out,byte type) throws TException {
switch (type) {
case TType.LIST:
    readOneList(in,out);
  break;
case TType.MAP:
readOneMap(in,out);
break;
case TType.SET:
readOneSet(in,out);
break;
case TType.STRUCT:
readOneStruct(in,out);
break;
case TType.STOP:
break;
case TType.BOOL:
out.writeBool(in.readBool());
break;
case TType.BYTE:
out.writeByte(in.readByte());
break;
case TType.DOUBLE:
out.writeDouble(in.readDouble());
break;
case TType.I16:
out.writeI16(in.readI16());
break;
case TType.ENUM:
case TType.I32:
out.writeI32(in.readI32());
break;
case TType.I64:
out.writeI64(in.readI64());
break;
case TType.STRING:
out.writeString(in.readString());
break;
case TType.VOID:
break;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}
Program: 112108
Project: 112108
Buggy source:
public SetConverter(List<TProtocol> parentEvents,GroupType parquetSchema,ThriftField field){
  super(parentEvents,parquetSchema,((ListType)field.getType()).getValues());
  this.parentEvents=parentEvents;
}

Fixed version (ground truth):
public SetConverter(List<TProtocol> parentEvents,GroupType parquetSchema,ThriftField field){
  super(parentEvents,parquetSchema,((SetType)field.getType()).getValues());
  this.parentEvents=parentEvents;
}
Program: 112109
Project: 112109
Buggy source:
public FieldPrimitiveConverter(List<TProtocol> events,ThriftField field){
  this.events=events;
}

Fixed version (ground truth):
public FieldPrimitiveConverter(List<TProtocol> events,ThriftField field){
  this.events=events;
  this.type=field.getType().getType();
}
Program: 112110
Project: 112110
Buggy source:
@Override public void addInt(final int value){
  events.add(new ParquetProtocol("String_Node_Str"){
    @Override public int readI32() throws TException {
      return value;
    }
  }
);
}

Fixed version (ground truth):
@Override public void addInt(final int value){
switch (type) {
case BYTE:
    events.add(new ParquetProtocol("String_Node_Str"){
      @Override public byte readByte() throws TException {
        return (byte)value;
      }
    }
);
  break;
case I16:
events.add(new ParquetProtocol("String_Node_Str"){
  @Override public short readI16() throws TException {
    return (short)value;
  }
}
);
break;
case I32:
events.add(new ParquetProtocol("String_Node_Str"){
@Override public int readI32() throws TException {
return value;
}
}
);
break;
default :
throw new UnsupportedOperationException("String_Node_Str" + type);
}
}
Program: 112111
Project: 112111
Buggy source:
private <T extends TBase<?,?>>void validate(T expected) throws TException {
  @SuppressWarnings("String_Node_Str") final Class<T> thriftClass=(Class<T>)expected.getClass();
  final MemPageStore memPageStore=new MemPageStore();
  final ThriftSchemaConverter schemaConverter=new ThriftSchemaConverter();
  final MessageType schema=schemaConverter.convert(thriftClass);
  final MessageColumnIO columnIO=new ColumnIOFactory().getColumnIO(schema);
  final MemColumnWriteStore columns=new MemColumnWriteStore(memPageStore,10000);
  final RecordConsumer recordWriter=columnIO.getRecordWriter(columns);
  final StructType thriftType=schemaConverter.toStructType(thriftClass);
  ParquetWriteProtocol parquetWriteProtocol=new ParquetWriteProtocol(recordWriter,columnIO,thriftType);
  expected.write(parquetWriteProtocol);
  columns.flush();
  ThriftRecordConverter<T> converter=new TBaseRecordConverter<T>(thriftClass,schema,thriftType);
  final RecordReader<T> recordReader=columnIO.getRecordReader(memPageStore,converter);
  final T result=recordReader.read();
  assertEquals(expected,result);
}

Fixed version (ground truth):
private <T extends TBase<?,?>>void validate(T expected) throws TException {
  @SuppressWarnings("String_Node_Str") final Class<T> thriftClass=(Class<T>)expected.getClass();
  final MemPageStore memPageStore=new MemPageStore();
  final ThriftSchemaConverter schemaConverter=new ThriftSchemaConverter();
  final MessageType schema=schemaConverter.convert(thriftClass);
  LOG.info(schema);
  final MessageColumnIO columnIO=new ColumnIOFactory().getColumnIO(schema);
  final MemColumnWriteStore columns=new MemColumnWriteStore(memPageStore,10000);
  final RecordConsumer recordWriter=columnIO.getRecordWriter(columns);
  final StructType thriftType=schemaConverter.toStructType(thriftClass);
  ParquetWriteProtocol parquetWriteProtocol=new ParquetWriteProtocol(recordWriter,columnIO,thriftType);
  expected.write(parquetWriteProtocol);
  columns.flush();
  ThriftRecordConverter<T> converter=new TBaseRecordConverter<T>(thriftClass,schema,thriftType);
  final RecordReader<T> recordReader=columnIO.getRecordReader(memPageStore,converter);
  final T result=recordReader.read();
  assertEquals(expected,result);
}
Program: 112112
Project: 112112
Buggy source:
/** 
 * give the number of bits needed to encode an int given the max value
 * @param bound max int that we want to encode
 * @return the number of bits required
 */
public static int getWidthFromMaxInt(int bound){
  return (int)Math.ceil(Math.log(bound + 1) / Math.log(2));
}

Fixed version (ground truth):
/** 
 * give the number of bits needed to encode an int given the max value
 * @param bound max int that we want to encode
 * @return the number of bits required
 */
public static int getWidthFromMaxInt(int bound){
  return (int)Math.ceil(Math.log((double)bound + 1) / Math.log(2));
}
Program: 112113
Project: 112113
Buggy source:
/** 
 * to initialize the column reader The underlying implementation knows how much data to read
 * @param in the array to read from
 * @param offset where to start reading from
 * @return the next offset to read from
 * @throws IOException
 */
public abstract int initFromPage(long valueCount,byte[] in,int offset) throws IOException ;

Fixed version (ground truth):
/** 
 * Called to initialize the column reader with a new page. The underlying implementation knows how much data to read <ul>The page contains the bytes for: <li> repetition levels column <li> definition levels column <li> data column </ul> Each column reader knows how much data to read and returns the next offset for the next column The data column always reads to the end and returns the array size.
 * @param valueCount count of values in this page
 * @param page the array to read from containing the page data (repetition levels, definition levels, data)
 * @param offset where to start reading from in the page
 * @return the offset to read from the next column (the page length in the case of the data column which is last in the page)
 * @throws IOException
 */
public abstract int initFromPage(long valueCount,byte[] page,int offset) throws IOException ;
Program: 112114
Project: 112114
Buggy source:
public long readLong(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public long readLong(){
  throw new UnsupportedOperationException();
}
Program: 112115
Project: 112115
Buggy source:
public double readDouble(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public double readDouble(){
  throw new UnsupportedOperationException();
}
Program: 112116
Project: 112116
Buggy source:
public float readFloat(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public float readFloat(){
  throw new UnsupportedOperationException();
}
Program: 112117
Project: 112117
Buggy source:
public byte[] readBytes(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public byte[] readBytes(){
  throw new UnsupportedOperationException();
}
Program: 112118
Project: 112118
Buggy source:
public boolean readBoolean(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public boolean readBoolean(){
  throw new UnsupportedOperationException();
}
Program: 112119
Project: 112119
Buggy source:
public int readInteger(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public int readInteger(){
  throw new UnsupportedOperationException();
}
Program: 112120
Project: 112120
Buggy source:
public int readByte(){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * @return the next boolean from the page
 */
public int readByte(){
  throw new UnsupportedOperationException();
}
Program: 112121
Project: 112121
Buggy source:
public Object getCurrentRecord(){
  return a;
}

Fixed version (ground truth):
@Override public Object getCurrentRecord(){
  return a;
}
Program: 112122
Project: 112122
Buggy source:
public GroupRecordConverter(MessageType schema){
  super(null,-1,schema);
  this.simpleGroupFactory=new SimpleGroupFactory(schema);
}

Fixed version (ground truth):
public GroupRecordConverter(MessageType schema){
  this.simpleGroupFactory=new SimpleGroupFactory(schema);
  this.root=new SimpleGroupConverter(null,0,schema){
    @Override public void start(){
      current=simpleGroupFactory.newGroup();
    }
    @Override public void end(){
    }
  }
;
}
Program: 112123
Project: 112123
Buggy source:
@Override public Group getCurrentRecord(){
  return current;
}

Fixed version (ground truth):
public Group getCurrentRecord(){
  return current;
}
Program: 112124
Project: 112124
Buggy source:
SimpleGroupConverter(SimpleGroupConverter parent,int index,GroupType schema){
  this.parent=parent;
  this.index=index;
  groupConverters=new GroupConverter[schema.getFieldCount()];
  primitiveConverters=new PrimitiveConverter[schema.getFieldCount()];
  for (int i=0; i < groupConverters.length; i++) {
    final Type type=schema.getType(i);
    if (type.isPrimitive()) {
      primitiveConverters[i]=new SimplePrimitiveConverter(this,i);
    }
 else {
      groupConverters[i]=new SimpleGroupConverter(this,i,type.asGroupType());
    }
  }
}

Fixed version (ground truth):
SimpleGroupConverter(SimpleGroupConverter parent,int index,GroupType schema){
  this.parent=parent;
  this.index=index;
  converters=new Converter[schema.getFieldCount()];
  for (int i=0; i < converters.length; i++) {
    final Type type=schema.getType(i);
    if (type.isPrimitive()) {
      converters[i]=new SimplePrimitiveConverter(this,i);
    }
 else {
      converters[i]=new SimpleGroupConverter(this,i,type.asGroupType());
    }
  }
}
Program: 112125
Project: 112125
Buggy source:
public MemColumnReader(ColumnDescriptor path,PageReader pageReader){
  this.path=path;
  this.pageReader=pageReader;
  this.totalValueCount=pageReader.getTotalValueCount();
}

Fixed version (ground truth):
public MemColumnReader(ColumnDescriptor path,PageReader pageReader){
  if (path == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (pageReader == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.path=path;
  this.pageReader=pageReader;
  this.totalValueCount=pageReader.getTotalValueCount();
  if (totalValueCount == 0) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 112126
Project: 112126
Buggy source:
public MemPageReader(int totalValueCount,Iterator<Page> pages){
  super();
  this.totalValueCount=totalValueCount;
  this.pages=pages;
}

Fixed version (ground truth):
public MemPageReader(int totalValueCount,Iterator<Page> pages){
  super();
  if (pages == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.totalValueCount=totalValueCount;
  this.pages=pages;
}
Program: 112127
Project: 112127
Buggy source:
@Override public PageReader getPageReader(ColumnDescriptor descriptor){
  MemPageWriter pageWriter=pageWriters.get(descriptor);
  if (pageWriter == null) {
    throw new UnknownColumnException(descriptor);
  }
  List<Page> pages=new ArrayList<Page>(pageWriter.getPages());
  return new MemPageReader(pageWriter.getTotalValueCount(),pages.iterator());
}

Fixed version (ground truth):
@Override public PageReader getPageReader(ColumnDescriptor descriptor){
  MemPageWriter pageWriter=pageWriters.get(descriptor);
  if (pageWriter == null) {
    throw new UnknownColumnException(descriptor);
  }
  List<Page> pages=new ArrayList<Page>(pageWriter.getPages());
  if (Log.DEBUG)   LOG.debug("String_Node_Str" + pageWriter.getTotalValueCount() + "String_Node_Str"+ pages.size()+ "String_Node_Str");
  return new MemPageReader(pageWriter.getTotalValueCount(),pages.iterator());
}
Program: 112128
Project: 112128
Buggy source:
@Override public PageWriter getPageWriter(ColumnDescriptor path){
  MemPageWriter pageWriter;
  if (pageWriters.containsKey(pageWriters)) {
    pageWriter=pageWriters.get(path);
  }
 else {
    pageWriter=new MemPageWriter();
    pageWriters.put(path,pageWriter);
  }
  return pageWriter;
}

Fixed version (ground truth):
@Override public PageWriter getPageWriter(ColumnDescriptor path){
  MemPageWriter pageWriter;
  if (pageWriters.containsKey(path)) {
    pageWriter=pageWriters.get(path);
  }
 else {
    pageWriter=new MemPageWriter();
    pageWriters.put(path,pageWriter);
  }
  return pageWriter;
}
Program: 112129
Project: 112129
Buggy source:
@Override public void writePage(BytesInput bytesInput,int valueCount){
  memSize+=bytesInput.size();
  pages.add(new Page(BytesInput.copy(bytesInput),valueCount));
  totalValueCount+=valueCount;
  if (DEBUG)   LOG.debug("String_Node_Str" + bytesInput.size() + "String_Node_Str"+ valueCount+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void writePage(BytesInput bytesInput,int valueCount){
  if (valueCount == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  memSize+=bytesInput.size();
  pages.add(new Page(BytesInput.copy(bytesInput),valueCount));
  totalValueCount+=valueCount;
  if (DEBUG)   LOG.debug("String_Node_Str" + bytesInput.size() + "String_Node_Str"+ valueCount+ "String_Node_Str");
}
Program: 112130
Project: 112130
Buggy source:
/** 
 * reads all the columns requested in the next block
 * @return the block data for the next block
 * @throws IOException if an error occurs while reading
 * @return how many records where read or 0 if end reached.
 */
public long readColumns(PageConsumer pageConsumer) throws IOException {
  if (currentBlock == blocks.size()) {
    return 0;
  }
  BlockMetaData block=blocks.get(currentBlock);
  LOG.info("String_Node_Str" + currentBlock);
  long t0=System.currentTimeMillis();
  for (  ColumnChunkMetaData mc : block.getColumns()) {
    String pathKey=Arrays.toString(mc.getPath());
    if (paths.contains(pathKey)) {
      f.seek(mc.getFirstDataPage());
      if (DEBUG)       LOG.debug(f.getPos() + "String_Node_Str" + Arrays.toString(mc.getPath())+ "String_Node_Str"+ mc.getType()+ "String_Node_Str"+ mc.getValueCount());
      long valuesCountReadSoFar=0;
      while (valuesCountReadSoFar < mc.getValueCount()) {
        PageHeader pageHeader=readNextDataPageHeader();
        pageConsumer.consumePage(mc.getPath(),pageHeader.data_page.num_values,f,pageHeader.compressed_page_size);
        valuesCountReadSoFar+=pageHeader.data_page.num_values;
      }
    }
  }
  long t1=System.currentTimeMillis();
  LOG.info("String_Node_Str" + (t1 - t0) + "String_Node_Str");
  ++currentBlock;
  return block.getRowCount();
}

Fixed version (ground truth):
/** 
 * reads all the columns requested in the next block
 * @return the block data for the next block
 * @throws IOException if an error occurs while reading
 * @return how many records where read or 0 if end reached.
 */
public long readColumns(PageConsumer pageConsumer) throws IOException {
  if (currentBlock == blocks.size()) {
    return 0;
  }
  BlockMetaData block=blocks.get(currentBlock);
  if (block.getRowCount() == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  LOG.info("String_Node_Str" + currentBlock);
  long t0=System.currentTimeMillis();
  for (  ColumnChunkMetaData mc : block.getColumns()) {
    String pathKey=Arrays.toString(mc.getPath());
    if (paths.contains(pathKey)) {
      f.seek(mc.getFirstDataPage());
      if (DEBUG)       LOG.debug(f.getPos() + "String_Node_Str" + Arrays.toString(mc.getPath())+ "String_Node_Str"+ mc.getType()+ "String_Node_Str"+ mc.getValueCount());
      long valuesCountReadSoFar=0;
      while (valuesCountReadSoFar < mc.getValueCount()) {
        PageHeader pageHeader=readNextDataPageHeader();
        pageConsumer.consumePage(mc.getPath(),pageHeader.data_page.num_values,f,pageHeader.compressed_page_size);
        valuesCountReadSoFar+=pageHeader.data_page.num_values;
      }
    }
  }
  long t1=System.currentTimeMillis();
  LOG.info("String_Node_Str" + (t1 - t0) + "String_Node_Str");
  ++currentBlock;
  return block.getRowCount();
}
Program: 112131
Project: 112131
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  checkRead();
  if (current < total) {
    currentValue=recordReader.read();
    current++;
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean nextKeyValue() throws IOException, InterruptedException {
  checkRead();
  if (current < total) {
    currentValue=recordReader.read();
    if (DEBUG)     LOG.debug("String_Node_Str" + currentValue);
    current++;
    return true;
  }
  return false;
}
Program: 112132
Project: 112132
Buggy source:
public void consumePage(String[] path,int valueCount,InputStream is,int pageSize){
  PageWriter pageWriter=memPageStore.getPageWriter(requestedSchema.getColumnDescription(path));
  pageWriter.writePage(BytesInput.from(is,pageSize),valueCount);
}

Fixed version (ground truth):
public void consumePage(String[] path,int valueCount,InputStream is,int pageSize){
  if (DEBUG)   LOG.debug("String_Node_Str" + Arrays.toString(path) + "String_Node_Str"+ valueCount+ "String_Node_Str"+ pageSize+ "String_Node_Str");
  PageWriter pageWriter=memPageStore.getPageWriter(requestedSchema.getColumnDescription(path));
  pageWriter.writePage(BytesInput.from(is,pageSize),valueCount);
}
Program: 112134
Project: 112134
Buggy source:
@Test public void testStorer() throws ExecException, Exception {
  String out="String_Node_Str";
  PigServer pigServer=new PigServer(ExecType.LOCAL);
  Data data=Storage.resetData(pigServer);
  Collection<Tuple> list=new ArrayList<Tuple>();
  for (int i=0; i < 1000; i++) {
    list.add(Storage.tuple("String_Node_Str" + i));
  }
  data.set("String_Node_Str","String_Node_Str",list);
  pigServer.setBatchOn();
  pigServer.registerQuery("String_Node_Str");
  pigServer.deleteFile(out);
  pigServer.registerQuery("String_Node_Str" + out + "String_Node_Str"+ RedelmStorer.class.getName()+ "String_Node_Str");
  if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) {
    throw new RuntimeException("String_Node_Str",pigServer.executeBatch().get(0).getException());
  }
  pigServer.registerQuery("String_Node_Str" + out + "String_Node_Str"+ RedelmLoader.class.getName()+ "String_Node_Str");
  pigServer.registerQuery("String_Node_Str");
  if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) {
    throw new RuntimeException("String_Node_Str",pigServer.executeBatch().get(0).getException());
  }
  List<Tuple> result=data.get("String_Node_Str");
  assertEquals(1000,result.size());
  int i=0;
  for (  Tuple tuple : result) {
    assertEquals("String_Node_Str" + i,tuple.get(0));
    ++i;
  }
}

Fixed version (ground truth):
@Test public void testStorer() throws ExecException, Exception {
  String out="String_Node_Str";
  int rows=10;
  PigServer pigServer=new PigServer(ExecType.LOCAL);
  Data data=Storage.resetData(pigServer);
  Collection<Tuple> list=new ArrayList<Tuple>();
  for (int i=0; i < rows; i++) {
    list.add(Storage.tuple("String_Node_Str" + i));
  }
  data.set("String_Node_Str","String_Node_Str",list);
  pigServer.setBatchOn();
  pigServer.registerQuery("String_Node_Str");
  pigServer.deleteFile(out);
  pigServer.registerQuery("String_Node_Str" + out + "String_Node_Str"+ RedelmStorer.class.getName()+ "String_Node_Str");
  if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) {
    throw new RuntimeException("String_Node_Str",pigServer.executeBatch().get(0).getException());
  }
  pigServer.registerQuery("String_Node_Str" + out + "String_Node_Str"+ RedelmLoader.class.getName()+ "String_Node_Str");
  pigServer.registerQuery("String_Node_Str");
  if (pigServer.executeBatch().get(0).getStatus() != JOB_STATUS.COMPLETED) {
    throw new RuntimeException("String_Node_Str",pigServer.executeBatch().get(0).getException());
  }
  List<Tuple> result=data.get("String_Node_Str");
  assertEquals(rows,result.size());
  int i=0;
  for (  Tuple tuple : result) {
    assertEquals("String_Node_Str" + i,tuple.get(0));
    ++i;
  }
}
Program: 112135
Project: 112135
Buggy source:
private void read(){
  if (!(repetitionLevelColumn instanceof DevNullColumnReader)) {
    repetitionLevel=repetitionLevelColumn.readInteger();
  }
  definitionLevel=definitionLevelColumn.readInteger();
  ++readValues;
  consumed=false;
}

Fixed version (ground truth):
private void read(){
  if (!(repetitionLevelColumn instanceof DevNullColumnReader)) {
    repetitionLevel=repetitionLevelColumn.readInteger();
  }
  if (!(definitionLevelColumn instanceof DevNullColumnReader)) {
    definitionLevel=definitionLevelColumn.readInteger();
  }
  ++readValues;
  consumed=false;
}
Program: 112136
Project: 112136
Buggy source:
private <S extends StatementBuilder<S>>S generateCase(boolean addPrimitive,State state,Case currentCase,S builder){
  if (currentCase.isGoingUp()) {
    for (int i=currentCase.getStartLevel(); i <= currentCase.getDepth(); i++) {
      String field=state.fieldPath[i];
      int index=state.indexFieldPath[i];
      builder=builder.exec().callOnThis("String_Node_Str").literal(field).nextParam().literal(index).endCall().endExec();
    }
  }
  if (addPrimitive) {
    String field=state.fieldPath[currentCase.getDepth() + 1];
    int index=state.indexFieldPath[currentCase.getDepth() + 1];
    builder=builder.exec().callOnThis("String_Node_Str" + state.primitive.name()).literal(field).nextParam().literal(index).nextParam().get("String_Node_Str" + state.id).endCall().endExec();
  }
  if (currentCase.isGoingDown()) {
    for (int i=currentCase.getDepth() + 1; i > currentCase.getNextLevel(); i--) {
      String field=state.fieldPath[i - 1];
      int index=state.indexFieldPath[i - 1];
      builder=builder.exec().callOnThis("String_Node_Str").literal(field).nextParam().literal(index).endCall().endExec();
    }
  }
  if (currentCase.isGoingDown()) {
    builder=builder.set("String_Node_Str").literal(currentCase.getNextLevel()).endSet();
  }
 else   if (currentCase.isGoingUp()) {
    builder=builder.set("String_Node_Str").literal(currentCase.getDepth() + 1).endSet();
  }
 else {
  }
  return builder;
}

Fixed version (ground truth):
private <S extends StatementBuilder<S>>S generateCase(boolean addPrimitive,State state,Case currentCase,S builder){
  if (currentCase.isGoingUp()) {
    for (int i=currentCase.getStartLevel(); i <= currentCase.getDepth(); i++) {
      String field=state.fieldPath[i];
      int index=state.indexFieldPath[i];
      builder=builder.exec().callOnThis("String_Node_Str").literal(field).nextParam().literal(index).endCall().endExec();
    }
  }
  if (addPrimitive) {
    builder=builder.exec().callOnThis("String_Node_Str" + state.primitive.name()).literal(state.primitiveField).nextParam().literal(state.primitiveFieldIndex).nextParam().get("String_Node_Str" + state.id).endCall().endExec();
  }
  if (currentCase.isGoingDown()) {
    for (int i=currentCase.getDepth() + 1; i > currentCase.getNextLevel(); i--) {
      String field=state.fieldPath[i - 1];
      int index=state.indexFieldPath[i - 1];
      builder=builder.exec().callOnThis("String_Node_Str").literal(field).nextParam().literal(index).endCall().endExec();
    }
  }
  if (currentCase.isGoingDown()) {
    builder=builder.set("String_Node_Str").literal(currentCase.getNextLevel()).endSet();
  }
 else   if (currentCase.isGoingUp()) {
    builder=builder.set("String_Node_Str").literal(currentCase.getDepth() + 1).endSet();
  }
 else {
  }
  return builder;
}
Program: 112137
Project: 112137
Buggy source:
protected void currentLevel(int currentLevel){
  LOG.debug("String_Node_Str" + currentLevel);
}

Fixed version (ground truth):
protected void currentLevel(int currentLevel){
  if (DEBUG)   LOG.debug("String_Node_Str" + currentLevel);
}
Program: 112139
Project: 112139
Buggy source:
public Class<?> define(FutureType type){
  new TypePrinter().print(type);
  byte[] classBytes=asmTypeGenerator.generate(type);
  return super.defineClass(type.getName(),classBytes,0,classBytes.length);
}

Fixed version (ground truth):
public Class<?> define(FutureType type){
  if (DEBUG)   new TypePrinter().print(type);
  byte[] classBytes=asmTypeGenerator.generate(type);
  return super.defineClass(type.getName(),classBytes,0,classBytes.length);
}
Program: 112141
Project: 112141
Buggy source:
public Collection<Case> getCases(){
  return cases;
}

Fixed version (ground truth):
public List<Case> getCases(){
  return cases;
}
Program: 112142
Project: 112142
Buggy source:
private static void read(RecordReader<Object> recordReader,int count,MessageType schema){
  long t0=System.currentTimeMillis();
  Object[] records=new Object[count];
  recordReader.read(records,count);
  long t1=System.currentTimeMillis();
  long t=t1 - t0;
  float err=(float)100 * 2 / t;
  System.out.printf("String_Node_Str",count,t,t == 0 ? 0 : count * 1000 / t,err);
  System.out.println(records[0]);
}

Fixed version (ground truth):
private static void read(RecordReader<Object> recordReader,int count,MessageType schema){
  long t0=System.currentTimeMillis();
  Object[] records=new Object[count];
  recordReader.read(records,count);
  long t1=System.currentTimeMillis();
  long t=t1 - t0;
  float err=(float)100 * 2 / t;
  System.out.printf("String_Node_Str",count,t,t == 0 ? 0 : count * 1000 / t,err);
  if (!records[0].equals("String_Node_Str")) {
    throw new RuntimeException();
  }
}
Program: 112143
Project: 112143
Buggy source:
public static void main(String[] args){
  MemColumnsStore columns=new MemColumnsStore(50 * 1024 * 1024,schema);
  write(columns);
  columns.flip();
  read(columns);
  System.out.println(columns.memSize() + "String_Node_Str");
  System.out.println("String_Node_Str" + columns.maxColMemSize() + "String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  MemColumnsStore columns=new MemColumnsStore(50 * 1024 * 1024,schema);
  write(columns);
  read(columns);
  System.out.println(columns.memSize() + "String_Node_Str");
  System.out.println("String_Node_Str" + columns.maxColMemSize() + "String_Node_Str");
}
Program: 112144
Project: 112144
Buggy source:
@Override public String readString(){
  try {
    int size=in.readInt();
    byte[] bytes=new byte[size];
    int i=0;
    do {
      int n=in.read(bytes,i,bytes.length - i);
      if (n == -1) {
        throw new RuntimeException("String_Node_Str");
      }
      i=i + n;
    }
 while (i < bytes.length);
    return new String(bytes,CHARSET);
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public String readString(){
  try {
    int size=in.readInt();
    if (size == 0) {
      return "String_Node_Str";
    }
 else {
      byte[] bytes=new byte[size];
      int i=0;
      do {
        int n=in.read(bytes,i,bytes.length - i);
        if (n == -1) {
          throw new RuntimeException("String_Node_Str");
        }
        i=i + n;
      }
 while (i < bytes.length);
      return new String(bytes,CHARSET);
    }
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 112146
Project: 112146
Buggy source:
@Override public void endMessage(){
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endMessage(){
  writeNullForMissingFields(((GroupColumnIO)currentColumnIO).getChildrenCount() - 1);
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}
Program: 112147
Project: 112147
Buggy source:
@Override public void addString(String value){
  if (DEBUG) {
    log(value);
  }
  delegate.addString(value);
}

Fixed version (ground truth):
@Override public void addString(String value){
  if (DEBUG)   log(value);
  delegate.addString(value);
}
Program: 112148
Project: 112148
Buggy source:
@Override public InputFormat<Object,Tuple> getInputFormat() throws IOException {
}

Fixed version (ground truth):
@Override public InputFormat<Object,Tuple> getInputFormat() throws IOException {
  return new InputFormat<Object,Tuple>(){
    @Override public RecordReader<Object,Tuple> createRecordReader(    InputSplit inputSplit,    TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
      return new RecordReader<Object,Tuple>(){
        private Tuple currentTuple;
        private int total;
        private int current;
        private boolean dataAvailable;
        private void checkRead(){
        }
        @Override public void close() throws IOException {
        }
        @Override public Object getCurrentKey() throws IOException, InterruptedException {
          return null;
        }
        @Override public Tuple getCurrentValue() throws IOException, InterruptedException {
          checkRead();
          if (!dataAvailable) {
            throw new IOException("String_Node_Str");
          }
          return currentTuple;
        }
        @Override public float getProgress() throws IOException, InterruptedException {
          return (float)current / total;
        }
        @Override public void initialize(        InputSplit inputSplit,        TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
        }
        @Override public boolean nextKeyValue() throws IOException, InterruptedException {
          checkRead();
          return dataAvailable;
        }
      }
;
    }
    @Override public List<InputSplit> getSplits(    JobContext jobContext) throws IOException, InterruptedException {
      return null;
    }
  }
;
}
Program: 112152
Project: 112152
Buggy source:
/** 
 * This setter is needed in implementation classes (along with a no-arg constructor) to avoid reference cycles in the Spring wiring of a RestfulServer instance.
 * @param theRestfulServer
 */
public void setRestfulServer(RestfulServer theRestfulServer);

Fixed version (ground truth):
/** 
 * This setter is needed in implementation classes (along with a no-arg constructor) to avoid reference cycles in the Spring wiring of a RestfulServer instance.
 * @param theRestfulServer
 */
void setRestfulServer(RestfulServer theRestfulServer);
Program: 112153
Project: 112153
Buggy source:
/** 
 * Actually create and return the conformance statement See the class documentation for an important note if you are extending this class
 */
public abstract T getServerConformance(HttpServletRequest theRequest);

Fixed version (ground truth):
/** 
 * Actually create and return the conformance statement See the class documentation for an important note if you are extending this class
 */
T getServerConformance(HttpServletRequest theRequest);
Program: 112154
Project: 112154
Buggy source:
/** 
 * Sets the resource providers for this server
 */
public void setResourceProviders(Collection<IResourceProvider> theResourceProviders){
  myResourceProviders.clear();
  if (theResourceProviders != null) {
    myResourceProviders.addAll(theResourceProviders);
  }
}

Fixed version (ground truth):
/** 
 * Sets the resource providers for this server
 */
public void setResourceProviders(IResourceProvider... theResourceProviders){
  myResourceProviders.clear();
  if (theResourceProviders != null) {
    myResourceProviders.addAll(Arrays.asList(theResourceProviders));
  }
}
Program: 112155
Project: 112155
Buggy source:
/** 
 * Sets the non-resource specific providers which implement method calls on this server.
 * @see #setResourceProviders(Collection)
 */
public void setPlainProviders(Collection<Object> theProviders){
  myPlainProviders.clear();
  if (theProviders != null) {
    myPlainProviders.addAll(theProviders);
  }
}

Fixed version (ground truth):
/** 
 * Sets the non-resource specific providers which implement method calls on this server.
 * @see #setResourceProviders(Collection)
 */
public void setPlainProviders(Object... theProv){
  setPlainProviders(Arrays.asList(theProv));
}
Program: 112156
Project: 112156
Buggy source:
public RestulfulServerConfiguration createConfiguration(){
  RestulfulServerConfiguration result=new RestulfulServerConfiguration();
  result.setResourceBindings(getResourceBindings());
  result.setServerBindings(getServerBindings());
  result.setImplementationDescription(getImplementationDescription());
  result.setServerVersion(getServerVersion());
  result.setServerName(getServerName());
  result.setFhirContext(getFhirContext());
  result.setServerAddressStrategy(myServerAddressStrategy);
  InputStream inputStream=null;
  try {
    inputStream=getClass().getResourceAsStream("String_Node_Str");
    if (inputStream != null) {
      Manifest manifest=new Manifest(inputStream);
      result.setConformanceDate(manifest.getMainAttributes().getValue("String_Node_Str"));
    }
  }
 catch (  IOException e) {
  }
 finally {
    if (inputStream != null) {
      IOUtils.closeQuietly(inputStream);
    }
  }
  return result;
}

Fixed version (ground truth):
public RestulfulServerConfiguration createConfiguration(){
  RestulfulServerConfiguration result=new RestulfulServerConfiguration();
  result.setResourceBindings(getResourceBindings());
  result.setServerBindings(getServerBindings());
  result.setImplementationDescription(getImplementationDescription());
  result.setServerVersion(getServerVersion());
  result.setServerName(getServerName());
  result.setFhirContext(getFhirContext());
  result.setServerAddressStrategy(myServerAddressStrategy);
  try (InputStream inputStream=getClass().getResourceAsStream("String_Node_Str")){
    if (inputStream != null) {
      Manifest manifest=new Manifest(inputStream);
      String value=manifest.getMainAttributes().getValue("String_Node_Str");
      result.setConformanceDate(new InstantDt(value));
    }
  }
 catch (  Exception e) {
  }
  return result;
}
Program: 112157
Project: 112157
Buggy source:
/** 
 * Sets (or clears) the list of interceptors
 * @param theList The list of interceptors (may be null)
 */
public void setInterceptors(IServerInterceptor... theList){
  myInterceptors.clear();
  if (theList != null) {
    myInterceptors.addAll(Arrays.asList(theList));
  }
}

Fixed version (ground truth):
/** 
 * Sets (or clears) the list of interceptors
 * @param theList The list of interceptors (may be null)
 */
public void setInterceptors(List<IServerInterceptor> theList){
  myInterceptors.clear();
  if (theList != null) {
    myInterceptors.addAll(theList);
  }
}
Program: 112158
Project: 112158
Buggy source:
/** 
 * Set the serverBindings
 * @param serverBindings the serverBindings to set
 */
public RestulfulServerConfiguration setServerBindings(List<BaseMethodBinding<?>> serverBindings){
  this.serverBindings=serverBindings;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the theServerBindings
 */
public RestulfulServerConfiguration setServerBindings(List<BaseMethodBinding<?>> theServerBindings){
  this.serverBindings=theServerBindings;
  return this;
}
Program: 112159
Project: 112159
Buggy source:
/** 
 * Set the conformanceDate
 * @param conformanceDate the conformanceDate to set
 */
public void setConformanceDate(String conformanceDate){
  this.conformanceDate=conformanceDate;
}

Fixed version (ground truth):
/** 
 * Set the date that will be specified in the conformance profile exported by this server. Typically this would be populated with an InstanceType.
 */
public void setConformanceDate(IPrimitiveType<Date> theConformanceDate){
  myConformanceDate=theConformanceDate;
}
Program: 112160
Project: 112160
Buggy source:
/** 
 * Get the conformanceDate
 * @return the conformanceDate
 */
public String getConformanceDate(){
  return conformanceDate;
}

Fixed version (ground truth):
/** 
 * Get the date that will be specified in the conformance profile exported by this server. Typically this would be populated with an InstanceType.
 */
public IPrimitiveType<Date> getConformanceDate(){
  return myConformanceDate;
}
Program: 112161
Project: 112161
Buggy source:
@Test public void testSearchReferenceParameterWithList() throws Exception {
  RestfulServer rsNoType=new RestfulServer(ourCtx);
  rsNoType.registerProvider(new SearchProviderWithListNoType());
  ServerCapabilityStatementProvider scNoType=new ServerCapabilityStatementProvider(rsNoType);
  rsNoType.setServerConformanceProvider(scNoType);
  rsNoType.init(createServletConfig());
  scNoType.getServerConfiguration().setConformanceDate("String_Node_Str");
  CapabilityStatement conformance=scNoType.getServerConformance(createHttpServletRequest());
  String confNoType=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance);
  ourLog.info(confNoType);
  RestfulServer rsWithType=new RestfulServer(ourCtx);
  rsWithType.registerProvider(new SearchProviderWithListWithType());
  ServerCapabilityStatementProvider scWithType=new ServerCapabilityStatementProvider(rsWithType);
  rsWithType.setServerConformanceProvider(scWithType);
  rsWithType.init(createServletConfig());
  scWithType.getServerConfiguration().setConformanceDate("String_Node_Str");
  CapabilityStatement conformanceWithType=scWithType.getServerConformance(createHttpServletRequest());
  String confWithType=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformanceWithType);
  ourLog.info(confWithType);
  assertEquals(confNoType,confWithType);
}

Fixed version (ground truth):
@Test public void testSearchReferenceParameterWithList() throws Exception {
  RestfulServer rsNoType=new RestfulServer(ourCtx){
    @Override public RestulfulServerConfiguration createConfiguration(){
      RestulfulServerConfiguration retVal=super.createConfiguration();
      retVal.setConformanceDate(new InstantDt("String_Node_Str"));
      return retVal;
    }
  }
;
  rsNoType.registerProvider(new SearchProviderWithListNoType());
  ServerCapabilityStatementProvider scNoType=new ServerCapabilityStatementProvider(rsNoType);
  rsNoType.setServerConformanceProvider(scNoType);
  rsNoType.init(createServletConfig());
  CapabilityStatement conformance=scNoType.getServerConformance(createHttpServletRequest());
  String confNoType=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance);
  ourLog.info(confNoType);
  RestfulServer rsWithType=new RestfulServer(ourCtx){
    @Override public RestulfulServerConfiguration createConfiguration(){
      RestulfulServerConfiguration retVal=super.createConfiguration();
      retVal.setConformanceDate(new InstantDt("String_Node_Str"));
      return retVal;
    }
  }
;
  rsWithType.registerProvider(new SearchProviderWithListWithType());
  ServerCapabilityStatementProvider scWithType=new ServerCapabilityStatementProvider(rsWithType);
  rsWithType.setServerConformanceProvider(scWithType);
  rsWithType.init(createServletConfig());
  CapabilityStatement conformanceWithType=scWithType.getServerConformance(createHttpServletRequest());
  String confWithType=ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformanceWithType);
  ourLog.info(confWithType);
  assertEquals(confNoType,confWithType);
  assertThat(confNoType,containsString("String_Node_Str"));
}
Program: 112162
Project: 112162
Buggy source:
public void testCreateWrongType() throws Exception {
  Binary res=new Binary();
  res.setContent(new byte[]{1,2,3,4});
  res.setContentType("String_Node_Str");
  String stringContent=ourCtx.newJsonParser().encodeResourceToString(res);
  HttpPost http=new HttpPost("String_Node_Str" + ourPort + "String_Node_Str");
  http.setEntity(new StringEntity(stringContent,ContentType.create(Constants.CT_FHIR_JSON,"String_Node_Str")));
  HttpResponse status=ourClient.execute(http);
  assertEquals(201,status.getStatusLine().getStatusCode());
  assertEquals("String_Node_Str",ourLast.getContentType());
  assertArrayEquals(new byte[]{1,2,3,4},ourLast.getContent());
}

Fixed version (ground truth):
@Test public void testCreateWrongType() throws Exception {
  Binary res=new Binary();
  res.setContent(new byte[]{1,2,3,4});
  res.setContentType("String_Node_Str");
  String stringContent=ourCtx.newJsonParser().encodeResourceToString(res);
  HttpPost http=new HttpPost("String_Node_Str" + ourPort + "String_Node_Str");
  http.setEntity(new StringEntity(stringContent,ContentType.create(Constants.CT_FHIR_JSON,"String_Node_Str")));
  HttpResponse status=ourClient.execute(http);
  assertEquals(201,status.getStatusLine().getStatusCode());
  assertEquals("String_Node_Str",ourLast.getContentType().replace("String_Node_Str","String_Node_Str").toLowerCase());
}