nus-yam/ex-repair huggingface dataset:
Program: 111943
Project: 111943
Buggy source:
static Type getType(PrimitiveTypeName type){
switch (type) {
case INT64:
    return Type.INT64;
case INT32:
  return Type.INT32;
case BOOLEAN:
return Type.BOOLEAN;
case BINARY:
return Type.BYTE_ARRAY;
case FLOAT:
return Type.FLOAT;
case DOUBLE:
return Type.DOUBLE;
case INT96:
return Type.INT96;
case FIXED_LEN_BYTE_ARRAY:
return Type.FIXED_LEN_BYTE_ARRAY;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
Type getType(PrimitiveTypeName type){
switch (type) {
case INT64:
    return Type.INT64;
case INT32:
  return Type.INT32;
case BOOLEAN:
return Type.BOOLEAN;
case BINARY:
return Type.BYTE_ARRAY;
case FLOAT:
return Type.FLOAT;
case DOUBLE:
return Type.DOUBLE;
case INT96:
return Type.INT96;
case FIXED_LEN_BYTE_ARRAY:
return Type.FIXED_LEN_BYTE_ARRAY;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}
Program: 111944
Project: 111944
Buggy source:
static Set<org.apache.parquet.column.Encoding> fromFormatEncodings(List<Encoding> encodings){
  Set<org.apache.parquet.column.Encoding> converted=new HashSet<org.apache.parquet.column.Encoding>();
  for (  Encoding encoding : encodings) {
    converted.add(getEncoding(encoding));
  }
  converted=Collections.unmodifiableSet(converted);
  Set<org.apache.parquet.column.Encoding> cached=cachedEncodingSets.putIfAbsent(converted,converted);
  if (cached == null) {
    cached=converted;
  }
  return cached;
}

Fixed version (ground truth):
Set<org.apache.parquet.column.Encoding> fromFormatEncodings(List<Encoding> encodings){
  Set<org.apache.parquet.column.Encoding> converted=new HashSet<org.apache.parquet.column.Encoding>();
  for (  Encoding encoding : encodings) {
    converted.add(getEncoding(encoding));
  }
  converted=Collections.unmodifiableSet(converted);
  Set<org.apache.parquet.column.Encoding> cached=cachedEncodingSets.putIfAbsent(converted,converted);
  if (cached == null) {
    cached=converted;
  }
  return cached;
}
Program: 111945
Project: 111945
Buggy source:
static ConvertedType getConvertedType(OriginalType type){
switch (type) {
case UTF8:
    return ConvertedType.UTF8;
case MAP:
  return ConvertedType.MAP;
case MAP_KEY_VALUE:
return ConvertedType.MAP_KEY_VALUE;
case LIST:
return ConvertedType.LIST;
case ENUM:
return ConvertedType.ENUM;
case DECIMAL:
return ConvertedType.DECIMAL;
case DATE:
return ConvertedType.DATE;
case TIME_MILLIS:
return ConvertedType.TIME_MILLIS;
case TIMESTAMP_MILLIS:
return ConvertedType.TIMESTAMP_MILLIS;
case INTERVAL:
return ConvertedType.INTERVAL;
case INT_8:
return ConvertedType.INT_8;
case INT_16:
return ConvertedType.INT_16;
case INT_32:
return ConvertedType.INT_32;
case INT_64:
return ConvertedType.INT_64;
case UINT_8:
return ConvertedType.UINT_8;
case UINT_16:
return ConvertedType.UINT_16;
case UINT_32:
return ConvertedType.UINT_32;
case UINT_64:
return ConvertedType.UINT_64;
case JSON:
return ConvertedType.JSON;
case BSON:
return ConvertedType.BSON;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}

Fixed version (ground truth):
ConvertedType getConvertedType(OriginalType type){
switch (type) {
case UTF8:
    return ConvertedType.UTF8;
case MAP:
  return ConvertedType.MAP;
case MAP_KEY_VALUE:
return ConvertedType.MAP_KEY_VALUE;
case LIST:
return ConvertedType.LIST;
case ENUM:
return ConvertedType.ENUM;
case DECIMAL:
return ConvertedType.DECIMAL;
case DATE:
return ConvertedType.DATE;
case TIME_MILLIS:
return ConvertedType.TIME_MILLIS;
case TIMESTAMP_MILLIS:
return ConvertedType.TIMESTAMP_MILLIS;
case INTERVAL:
return ConvertedType.INTERVAL;
case INT_8:
return ConvertedType.INT_8;
case INT_16:
return ConvertedType.INT_16;
case INT_32:
return ConvertedType.INT_32;
case INT_64:
return ConvertedType.INT_64;
case UINT_8:
return ConvertedType.UINT_8;
case UINT_16:
return ConvertedType.UINT_16;
case UINT_32:
return ConvertedType.UINT_32;
case UINT_64:
return ConvertedType.UINT_64;
case JSON:
return ConvertedType.JSON;
case BSON:
return ConvertedType.BSON;
default :
throw new RuntimeException("String_Node_Str" + type);
}
}
Program: 111947
Project: 111947
Buggy source:
@Override public void writePage(BytesInput bytes,int valueCount,Statistics statistics,Encoding rlEncoding,Encoding dlEncoding,Encoding valuesEncoding) throws IOException {
  long uncompressedSize=bytes.size();
  if (uncompressedSize > Integer.MAX_VALUE) {
    throw new ParquetEncodingException("String_Node_Str" + uncompressedSize);
  }
  BytesInput compressedBytes=compressor.compress(bytes);
  long compressedSize=compressedBytes.size();
  if (compressedSize > Integer.MAX_VALUE) {
    throw new ParquetEncodingException("String_Node_Str" + compressedSize);
  }
  tempOutputStream.reset();
  ParquetMetadataConverter.writeDataPageHeader((int)uncompressedSize,(int)compressedSize,valueCount,statistics,rlEncoding,dlEncoding,valuesEncoding,tempOutputStream);
  this.uncompressedLength+=uncompressedSize;
  this.compressedLength+=compressedSize;
  this.totalValueCount+=valueCount;
  this.pageCount+=1;
  this.totalStatistics.mergeStatistics(statistics);
  buf.collect(BytesInput.concat(BytesInput.from(tempOutputStream),compressedBytes));
  encodings.add(rlEncoding);
  encodings.add(dlEncoding);
  encodings.add(valuesEncoding);
}

Fixed version (ground truth):
@Override public void writePage(BytesInput bytes,int valueCount,Statistics statistics,Encoding rlEncoding,Encoding dlEncoding,Encoding valuesEncoding) throws IOException {
  long uncompressedSize=bytes.size();
  if (uncompressedSize > Integer.MAX_VALUE) {
    throw new ParquetEncodingException("String_Node_Str" + uncompressedSize);
  }
  BytesInput compressedBytes=compressor.compress(bytes);
  long compressedSize=compressedBytes.size();
  if (compressedSize > Integer.MAX_VALUE) {
    throw new ParquetEncodingException("String_Node_Str" + compressedSize);
  }
  tempOutputStream.reset();
  parquetMetadataConverter.writeDataPageHeader((int)uncompressedSize,(int)compressedSize,valueCount,statistics,rlEncoding,dlEncoding,valuesEncoding,tempOutputStream);
  this.uncompressedLength+=uncompressedSize;
  this.compressedLength+=compressedSize;
  this.totalValueCount+=valueCount;
  this.pageCount+=1;
  this.totalStatistics.mergeStatistics(statistics);
  buf.collect(BytesInput.concat(BytesInput.from(tempOutputStream),compressedBytes));
  encodings.add(rlEncoding);
  encodings.add(dlEncoding);
  encodings.add(valuesEncoding);
}
Program: 111948
Project: 111948
Buggy source:
@Override public void writePageV2(int rowCount,int nullCount,int valueCount,BytesInput repetitionLevels,BytesInput definitionLevels,Encoding dataEncoding,BytesInput data,Statistics<?> statistics) throws IOException {
  int rlByteLength=toIntWithCheck(repetitionLevels.size());
  int dlByteLength=toIntWithCheck(definitionLevels.size());
  int uncompressedSize=toIntWithCheck(data.size() + repetitionLevels.size() + definitionLevels.size());
  BytesInput compressedData=compressor.compress(data);
  int compressedSize=toIntWithCheck(compressedData.size() + repetitionLevels.size() + definitionLevels.size());
  tempOutputStream.reset();
  ParquetMetadataConverter.writeDataPageV2Header(uncompressedSize,compressedSize,valueCount,nullCount,rowCount,statistics,dataEncoding,rlByteLength,dlByteLength,tempOutputStream);
  this.uncompressedLength+=uncompressedSize;
  this.compressedLength+=compressedSize;
  this.totalValueCount+=valueCount;
  this.pageCount+=1;
  this.totalStatistics.mergeStatistics(statistics);
  buf.collect(BytesInput.concat(BytesInput.from(tempOutputStream),repetitionLevels,definitionLevels,compressedData));
  encodings.add(dataEncoding);
}

Fixed version (ground truth):
@Override public void writePageV2(int rowCount,int nullCount,int valueCount,BytesInput repetitionLevels,BytesInput definitionLevels,Encoding dataEncoding,BytesInput data,Statistics<?> statistics) throws IOException {
  int rlByteLength=toIntWithCheck(repetitionLevels.size());
  int dlByteLength=toIntWithCheck(definitionLevels.size());
  int uncompressedSize=toIntWithCheck(data.size() + repetitionLevels.size() + definitionLevels.size());
  BytesInput compressedData=compressor.compress(data);
  int compressedSize=toIntWithCheck(compressedData.size() + repetitionLevels.size() + definitionLevels.size());
  tempOutputStream.reset();
  parquetMetadataConverter.writeDataPageV2Header(uncompressedSize,compressedSize,valueCount,nullCount,rowCount,statistics,dataEncoding,rlByteLength,dlByteLength,tempOutputStream);
  this.uncompressedLength+=uncompressedSize;
  this.compressedLength+=compressedSize;
  this.totalValueCount+=valueCount;
  this.pageCount+=1;
  this.totalStatistics.mergeStatistics(statistics);
  buf.collect(BytesInput.concat(BytesInput.from(tempOutputStream),repetitionLevels,definitionLevels,compressedData));
  encodings.add(dataEncoding);
}
Program: 111951
Project: 111951
Buggy source:
/** 
 * writes a single page
 * @param valueCount count of values
 * @param uncompressedPageSize the size of the data once uncompressed
 * @param bytes the compressed data for the page without header
 * @param rlEncoding encoding of the repetition level
 * @param dlEncoding encoding of the definition level
 * @param valuesEncoding encoding of values
 */
public void writeDataPage(int valueCount,int uncompressedPageSize,BytesInput bytes,Statistics statistics,Encoding rlEncoding,Encoding dlEncoding,Encoding valuesEncoding) throws IOException {
  state=state.write();
  long beforeHeader=out.getPos();
  if (DEBUG)   LOG.debug(beforeHeader + "String_Node_Str" + valueCount+ "String_Node_Str");
  int compressedPageSize=(int)bytes.size();
  ParquetMetadataConverter.writeDataPageHeader(uncompressedPageSize,compressedPageSize,valueCount,statistics,rlEncoding,dlEncoding,valuesEncoding,out);
  long headerSize=out.getPos() - beforeHeader;
  this.uncompressedLength+=uncompressedPageSize + headerSize;
  this.compressedLength+=compressedPageSize + headerSize;
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + compressedPageSize);
  bytes.writeAllTo(out);
  currentStatistics.mergeStatistics(statistics);
  currentEncodings.add(rlEncoding);
  currentEncodings.add(dlEncoding);
  currentEncodings.add(valuesEncoding);
}

Fixed version (ground truth):
/** 
 * writes a single page
 * @param valueCount count of values
 * @param uncompressedPageSize the size of the data once uncompressed
 * @param bytes the compressed data for the page without header
 * @param rlEncoding encoding of the repetition level
 * @param dlEncoding encoding of the definition level
 * @param valuesEncoding encoding of values
 */
public void writeDataPage(int valueCount,int uncompressedPageSize,BytesInput bytes,Statistics statistics,Encoding rlEncoding,Encoding dlEncoding,Encoding valuesEncoding) throws IOException {
  state=state.write();
  long beforeHeader=out.getPos();
  if (DEBUG)   LOG.debug(beforeHeader + "String_Node_Str" + valueCount+ "String_Node_Str");
  int compressedPageSize=(int)bytes.size();
  metadataConverter.writeDataPageHeader(uncompressedPageSize,compressedPageSize,valueCount,statistics,rlEncoding,dlEncoding,valuesEncoding,out);
  long headerSize=out.getPos() - beforeHeader;
  this.uncompressedLength+=uncompressedPageSize + headerSize;
  this.compressedLength+=compressedPageSize + headerSize;
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + compressedPageSize);
  bytes.writeAllTo(out);
  currentStatistics.mergeStatistics(statistics);
  currentEncodings.add(rlEncoding);
  currentEncodings.add(dlEncoding);
  currentEncodings.add(valuesEncoding);
}
Program: 111952
Project: 111952
Buggy source:
/** 
 * writes a dictionary page page
 * @param dictionaryPage the dictionary page
 */
public void writeDictionaryPage(DictionaryPage dictionaryPage) throws IOException {
  state=state.write();
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + dictionaryPage.getDictionarySize()+ "String_Node_Str");
  currentChunkDictionaryPageOffset=out.getPos();
  int uncompressedSize=dictionaryPage.getUncompressedSize();
  int compressedPageSize=(int)dictionaryPage.getBytes().size();
  ParquetMetadataConverter.writeDictionaryPageHeader(uncompressedSize,compressedPageSize,dictionaryPage.getDictionarySize(),dictionaryPage.getEncoding(),out);
  long headerSize=out.getPos() - currentChunkDictionaryPageOffset;
  this.uncompressedLength+=uncompressedSize + headerSize;
  this.compressedLength+=compressedPageSize + headerSize;
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + compressedPageSize);
  dictionaryPage.getBytes().writeAllTo(out);
  currentEncodings.add(dictionaryPage.getEncoding());
}

Fixed version (ground truth):
/** 
 * writes a dictionary page page
 * @param dictionaryPage the dictionary page
 */
public void writeDictionaryPage(DictionaryPage dictionaryPage) throws IOException {
  state=state.write();
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + dictionaryPage.getDictionarySize()+ "String_Node_Str");
  currentChunkDictionaryPageOffset=out.getPos();
  int uncompressedSize=dictionaryPage.getUncompressedSize();
  int compressedPageSize=(int)dictionaryPage.getBytes().size();
  metadataConverter.writeDictionaryPageHeader(uncompressedSize,compressedPageSize,dictionaryPage.getDictionarySize(),dictionaryPage.getEncoding(),out);
  long headerSize=out.getPos() - currentChunkDictionaryPageOffset;
  this.uncompressedLength+=uncompressedSize + headerSize;
  this.compressedLength+=compressedPageSize + headerSize;
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + compressedPageSize);
  dictionaryPage.getBytes().writeAllTo(out);
  currentEncodings.add(dictionaryPage.getEncoding());
}
Program: 111953
Project: 111953
Buggy source:
private static void serializeFooter(ParquetMetadata footer,FSDataOutputStream out) throws IOException {
  long footerIndex=out.getPos();
  org.apache.parquet.format.FileMetaData parquetMetadata=ParquetMetadataConverter.toParquetMetadata(CURRENT_VERSION,footer);
  writeFileMetaData(parquetMetadata,out);
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + (out.getPos() - footerIndex));
  BytesUtils.writeIntLittleEndian(out,(int)(out.getPos() - footerIndex));
  out.write(MAGIC);
}

Fixed version (ground truth):
private static void serializeFooter(ParquetMetadata footer,FSDataOutputStream out) throws IOException {
  long footerIndex=out.getPos();
  org.apache.parquet.format.FileMetaData parquetMetadata=metadataConverter.toParquetMetadata(CURRENT_VERSION,footer);
  writeFileMetaData(parquetMetadata,out);
  if (DEBUG)   LOG.debug(out.getPos() + "String_Node_Str" + (out.getPos() - footerIndex));
  BytesUtils.writeIntLittleEndian(out,(int)(out.getPos() - footerIndex));
  out.write(MAGIC);
}
Program: 111955
Project: 111955
Buggy source:
@Override public byte[] getMinBytes(){
  return min.getBytes();
}

Fixed version (ground truth):
@Override public byte[] getMinBytes(){
  return min == null ? null : min.getBytes();
}
Program: 111956
Project: 111956
Buggy source:
@Override public byte[] getMaxBytes(){
  return max.getBytes();
}

Fixed version (ground truth):
@Override public byte[] getMaxBytes(){
  return max == null ? null : max.getBytes();
}
Program: 111957
Project: 111957
Buggy source:
/** 
 * @param valid whether the argument is valid
 * @param message error message if the argument is not valid
 * @throws IllegalStateException if !valid
 */
public static void checkState(boolean valid,String message) throws IllegalStateException {
  if (!valid) {
    throw new IllegalStateException(message);
  }
}

Fixed version (ground truth):
/** 
 * Precondition-style validation that throws   {@link IllegalStateException}.
 * @param isValid {@code true} if valid, {@code false} if an exception should bethrown
 * @param message A String message for the exception.
 * @param args Objects used to fill in  {@code %s} placeholders in the message
 * @throws IllegalStateException if {@code isValid} is false
 */
public static void checkState(boolean isValid,String message,Object... args) throws IllegalStateException {
  if (!isValid) {
    throw new IllegalStateException(String.format(String.valueOf(message),strings(args)));
  }
}
Program: 111958
Project: 111958
Buggy source:
/** 
 * @param valid whether the argument is valid
 * @param message error message if the argument is not valid
 * @throws IllegalArgumentException if !valid
 */
public static void checkArgument(boolean valid,String message) throws IllegalArgumentException {
  if (!valid) {
    throw new IllegalArgumentException(message);
  }
}

Fixed version (ground truth):
/** 
 * Precondition-style validation that throws   {@link IllegalArgumentException}.
 * @param isValid {@code true} if valid, {@code false} if an exception should bethrown
 * @param message A String message for the exception.
 * @param args Objects used to fill in  {@code %s} placeholders in the message
 * @throws IllegalArgumentException if {@code isValid} is false
 */
public static void checkArgument(boolean isValid,String message,Object... args) throws IllegalArgumentException {
  if (!isValid) {
    throw new IllegalArgumentException(String.format(String.valueOf(message),strings(args)));
  }
}
Program: 111959
Project: 111959
Buggy source:
public static void validateBuffer(byte[] buffer,int off,int len){
  Preconditions.checkNotNull(buffer,"String_Node_Str");
  Preconditions.checkArgument(off >= 0 && len >= 0 && off <= buffer.length - len,"String_Node_Str" + buffer.length + "String_Node_Str"+ off+ "String_Node_Str"+ len);
}

Fixed version (ground truth):
public static void validateBuffer(byte[] buffer,int off,int len){
  Preconditions.checkNotNull(buffer,"String_Node_Str");
  Preconditions.checkArgument(off >= 0 && len >= 0 && off <= buffer.length - len,"String_Node_Str",buffer.length,off,len);
}
Program: 111960
Project: 111960
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void sourceConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  super.sourceConfInit(fp,tap,jobConf);
  jobConf.setInputFormat(DeprecatedParquetInputFormat.class);
  ParquetInputFormat.setReadSupportClass(jobConf,ThriftReadSupport.class);
  ThriftReadSupport.setRecordConverterClass(jobConf,TBaseRecordConverter.class);
}

Fixed version (ground truth):
@Override public void sourceConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  super.sourceConfInit(fp,tap,jobConf);
  jobConf.setInputFormat(DeprecatedParquetInputFormat.class);
  ParquetInputFormat.setReadSupportClass(jobConf,ThriftReadSupport.class);
  ThriftReadSupport.setRecordConverterClass(jobConf,TBaseRecordConverter.class);
}
Program: 111961
Project: 111961
Buggy source:
public ParquetTBaseScheme(Config config){
  super(config);
}

Fixed version (ground truth):
public ParquetTBaseScheme(Config<T> config){
  super(config);
}
Program: 111962
Project: 111962
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void sinkConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  if (this.config.getKlass() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  jobConf.setOutputFormat(DeprecatedParquetOutputFormat.class);
  DeprecatedParquetOutputFormat.setWriteSupportClass(jobConf,ThriftWriteSupport.class);
  ThriftWriteSupport.<T>setThriftClass(jobConf,this.config.getKlass());
}

Fixed version (ground truth):
@Override public void sinkConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  if (this.config.getKlass() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  jobConf.setOutputFormat(DeprecatedParquetOutputFormat.class);
  DeprecatedParquetOutputFormat.setWriteSupportClass(jobConf,ThriftWriteSupport.class);
  ThriftWriteSupport.<T>setThriftClass(jobConf,this.config.getKlass());
}
Program: 111963
Project: 111963
Buggy source:
public Config withRecordClass(Class<T> klass){
  return new Config(checkNotNull(klass,"String_Node_Str"),this.filterPredicate,this.projectionString);
}

Fixed version (ground truth):
public Config<T> withRecordClass(Class<T> klass){
  return new Config<T>(checkNotNull(klass,"String_Node_Str"),this.filterPredicate,this.projectionString);
}
Program: 111964
Project: 111964
Buggy source:
@Override public void sink(FlowProcess<JobConf> fp,SinkCall<Object[],OutputCollector> sc) throws IOException {
  TupleEntry tuple=sc.getOutgoingEntry();
  if (tuple.size() != 1) {
    throw new RuntimeException("String_Node_Str" + tuple.getFields());
  }
  T value=(T)tuple.getObject(0);
  OutputCollector output=sc.getOutput();
  output.collect(null,value);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void sink(FlowProcess<JobConf> fp,SinkCall<Object[],OutputCollector> sc) throws IOException {
  TupleEntry tuple=sc.getOutgoingEntry();
  if (tuple.size() != 1) {
    throw new RuntimeException("String_Node_Str" + tuple.getFields());
  }
  T value=(T)tuple.getObject(0);
  OutputCollector output=sc.getOutput();
  output.collect(null,value);
}
Program: 111965
Project: 111965
Buggy source:
public Config withFilterPredicate(FilterPredicate f){
  return new Config(this.klass,checkNotNull(f,"String_Node_Str"),this.projectionString);
}

Fixed version (ground truth):
public Config<T> withFilterPredicate(FilterPredicate f){
  return new Config<T>(this.klass,checkNotNull(f,"String_Node_Str"),this.projectionString);
}
Program: 111966
Project: 111966
Buggy source:
public ParquetValueScheme(Config config){
  this.config=config;
}

Fixed version (ground truth):
public ParquetValueScheme(Config<T> config){
  this.config=config;
}
Program: 111967
Project: 111967
Buggy source:
public Config withProjectionString(String p){
  return new Config(this.klass,this.filterPredicate,checkNotNull(p,"String_Node_Str"));
}

Fixed version (ground truth):
public Config<T> withProjectionString(String p){
  return new Config<T>(this.klass,this.filterPredicate,checkNotNull(p,"String_Node_Str"));
}
Program: 111968
Project: 111968
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void sourceConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  super.sourceConfInit(fp,tap,jobConf);
  jobConf.setInputFormat(DeprecatedParquetInputFormat.class);
  ParquetInputFormat.setReadSupportClass(jobConf,ScroogeReadSupport.class);
  ThriftReadSupport.setRecordConverterClass(jobConf,ScroogeRecordConverter.class);
}

Fixed version (ground truth):
@Override public void sourceConfInit(FlowProcess<JobConf> fp,Tap<JobConf,RecordReader,OutputCollector> tap,JobConf jobConf){
  super.sourceConfInit(fp,tap,jobConf);
  jobConf.setInputFormat(DeprecatedParquetInputFormat.class);
  ParquetInputFormat.setReadSupportClass(jobConf,ScroogeReadSupport.class);
  ThriftReadSupport.setRecordConverterClass(jobConf,ScroogeRecordConverter.class);
}
Program: 111969
Project: 111969
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void sinkConfInit(FlowProcess<JobConf> arg0,Tap<JobConf,RecordReader,OutputCollector> arg1,JobConf arg2){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void sinkConfInit(FlowProcess<JobConf> arg0,Tap<JobConf,RecordReader,OutputCollector> arg1,JobConf arg2){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 111970
Project: 111970
Buggy source:
public ParquetScroogeScheme(Config config){
  super(config);
}

Fixed version (ground truth):
public ParquetScroogeScheme(Config<T> config){
  super(config);
}
Program: 111971
Project: 111971
Buggy source:
@Override public String toStringUsingUTF8(){
  return new String(getBytes(),BytesUtils.UTF8);
}

Fixed version (ground truth):
@Override public String toStringUsingUTF8(){
  return UTF8.decode(value).toString();
}
Program: 111972
Project: 111972
Buggy source:
@Override public void writeBytes(Binary value){
  if (!dictionaryTooBig) {
    int id=binaryDictionaryContent.getInt(value);
    if (id == -1) {
      id=binaryDictionaryContent.size();
      binaryDictionaryContent.put(value,id);
      dictionaryByteSize+=length;
    }
    encodedValues.add(id);
    checkAndFallbackIfNeeded();
  }
 else {
    plainValuesWriter.writeBytes(value);
  }
  rawDataByteSize+=length;
}

Fixed version (ground truth):
@Override public void writeBytes(Binary value){
  if (!dictionaryTooBig) {
    int id=binaryDictionaryContent.getInt(value);
    if (id == -1) {
      id=binaryDictionaryContent.size();
      binaryDictionaryContent.put(copy(value),id);
      dictionaryByteSize+=length;
    }
    encodedValues.add(id);
    checkAndFallbackIfNeeded();
  }
 else {
    plainValuesWriter.writeBytes(value);
  }
  rawDataByteSize+=length;
}
Program: 111975
Project: 111975
Buggy source:
private void initSchema(Job job) throws IOException {
  if (schema != null) {
    return;
  }
  if (requestedSchema != null) {
    schema=requestedSchema;
    return;
  }
  schema=PigSchemaConverter.parsePigSchema(getPropertyFromUDFContext(PARQUET_PIG_SCHEMA));
  if (schema == null) {
    final GlobalMetaData globalMetaData=getParquetInputFormat().getGlobalMetaData(job);
    schema=getPigSchemaFromMultipleFiles(globalMetaData.getSchema(),globalMetaData.getKeyValueMetaData());
  }
  if (isElephantBirdCompatible(job)) {
    convertToElephantBirdCompatibleSchema(schema);
  }
}

Fixed version (ground truth):
private void initSchema(Job job) throws IOException {
  if (schema != null) {
    return;
  }
  schema=PigSchemaConverter.parsePigSchema(getPropertyFromUDFContext(PARQUET_PIG_SCHEMA));
  if (schema == null && requestedSchema != null) {
    schema=requestedSchema;
    return;
  }
  if (schema == null) {
    final GlobalMetaData globalMetaData=getParquetInputFormat().getGlobalMetaData(job);
    schema=getPigSchemaFromMultipleFiles(globalMetaData.getSchema(),globalMetaData.getKeyValueMetaData());
  }
  if (isElephantBirdCompatible(job)) {
    convertToElephantBirdCompatibleSchema(schema);
  }
}
Program: 111976
Project: 111976
Buggy source:
public static ColumnChunkProperties get(ColumnPath path,PrimitiveTypeName type,CompressionCodecName codec,Set<Encoding> encodings){
  ColumnChunkProperties key=new ColumnChunkProperties(codec,path,type,encodings);
  ColumnChunkProperties cached=cache.get(key);
  if (cached == null) {
    cached=key;
    cache.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static ColumnChunkProperties get(ColumnPath path,PrimitiveTypeName type,CompressionCodecName codec,Set<Encoding> encodings){
  return properties.canonicalize(new ColumnChunkProperties(codec,path,type,encodings));
}
Program: 111977
Project: 111977
Buggy source:
public static ColumnPath get(String... path){
  ColumnPath key=new ColumnPath(path);
  ColumnPath cached=paths.get(key);
  if (cached == null) {
    for (int i=0; i < path.length; i++) {
      path[i]=path[i].intern();
    }
    cached=key;
    paths.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static ColumnPath get(String... path){
  return paths.canonicalize(new ColumnPath(path));
}
Program: 111978
Project: 111978
Buggy source:
public static EncodingList getEncodingList(List<Encoding> encodings){
  EncodingList key=new EncodingList(encodings);
  EncodingList cached=encodingLists.get(key);
  if (cached == null) {
    cached=key;
    encodingLists.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static EncodingList getEncodingList(List<Encoding> encodings){
  return encodingLists.canonicalize(new EncodingList(encodings));
}
Program: 111979
Project: 111979
Buggy source:
public static ColumnChunkProperties get(ColumnPath path,PrimitiveTypeName type,CompressionCodecName codec,Set<Encoding> encodings){
  ColumnChunkProperties key=new ColumnChunkProperties(codec,path,type,encodings);
  ColumnChunkProperties cached=cache.get(key);
  if (cached == null) {
    cached=key;
    cache.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static ColumnChunkProperties get(ColumnPath path,PrimitiveTypeName type,CompressionCodecName codec,Set<Encoding> encodings){
  return properties.canonicalize(new ColumnChunkProperties(codec,path,type,encodings));
}
Program: 111980
Project: 111980
Buggy source:
public static ColumnPath get(String... path){
  ColumnPath key=new ColumnPath(path);
  ColumnPath cached=paths.get(key);
  if (cached == null) {
    for (int i=0; i < path.length; i++) {
      path[i]=path[i].intern();
    }
    cached=key;
    paths.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static ColumnPath get(String... path){
  return paths.canonicalize(new ColumnPath(path));
}
Program: 111981
Project: 111981
Buggy source:
public static EncodingList getEncodingList(List<Encoding> encodings){
  EncodingList key=new EncodingList(encodings);
  EncodingList cached=encodingLists.get(key);
  if (cached == null) {
    cached=key;
    encodingLists.put(key,cached);
  }
  return cached;
}

Fixed version (ground truth):
public static EncodingList getEncodingList(List<Encoding> encodings){
  return encodingLists.canonicalize(new EncodingList(encodings));
}
Program: 111982
Project: 111982
Buggy source:
public static void dump(PrettyPrintWriter out,ColumnReadStoreImpl crstore,ColumnDescriptor column,long page,long total,long offset) throws IOException {
  int dmax=column.getMaxDefinitionLevel();
  ColumnReader creader=crstore.getColumnReader(column);
  out.format("String_Node_Str",page,total,offset,offset + creader.getTotalValueCount() - 1);
  for (long i=0, e=creader.getTotalValueCount(); i < e; ++i) {
    int rlvl=creader.getCurrentDefinitionLevel();
    int dlvl=creader.getCurrentDefinitionLevel();
    out.format("String_Node_Str",offset + i,rlvl,dlvl);
    if (dlvl == dmax) {
switch (column.getType()) {
case BINARY:
        out.format("String_Node_Str",binaryToString(creader.getBinary()));
      break;
case BOOLEAN:
    out.format("String_Node_Str",creader.getBoolean());
  break;
case DOUBLE:
out.format("String_Node_Str",creader.getDouble());
break;
case FLOAT:
out.format("String_Node_Str",creader.getFloat());
break;
case INT32:
out.format("String_Node_Str",creader.getInteger());
break;
case INT64:
out.format("String_Node_Str",creader.getLong());
break;
case INT96:
out.format("String_Node_Str",binaryToBigInteger(creader.getBinary()));
break;
case FIXED_LEN_BYTE_ARRAY:
out.format("String_Node_Str",binaryToString(creader.getBinary()));
break;
}
}
 else {
out.format("String_Node_Str");
}
out.println();
creader.consume();
}
}

Fixed version (ground truth):
public static void dump(PrettyPrintWriter out,ColumnReadStoreImpl crstore,ColumnDescriptor column,long page,long total,long offset) throws IOException {
  int dmax=column.getMaxDefinitionLevel();
  ColumnReader creader=crstore.getColumnReader(column);
  out.format("String_Node_Str",page,total,offset,offset + creader.getTotalValueCount() - 1);
  for (long i=0, e=creader.getTotalValueCount(); i < e; ++i) {
    int rlvl=creader.getCurrentRepetitionLevel();
    int dlvl=creader.getCurrentDefinitionLevel();
    out.format("String_Node_Str",offset + i,rlvl,dlvl);
    if (dlvl == dmax) {
switch (column.getType()) {
case BINARY:
        out.format("String_Node_Str",binaryToString(creader.getBinary()));
      break;
case BOOLEAN:
    out.format("String_Node_Str",creader.getBoolean());
  break;
case DOUBLE:
out.format("String_Node_Str",creader.getDouble());
break;
case FLOAT:
out.format("String_Node_Str",creader.getFloat());
break;
case INT32:
out.format("String_Node_Str",creader.getInteger());
break;
case INT64:
out.format("String_Node_Str",creader.getLong());
break;
case INT96:
out.format("String_Node_Str",binaryToBigInteger(creader.getBinary()));
break;
case FIXED_LEN_BYTE_ARRAY:
out.format("String_Node_Str",binaryToString(creader.getBinary()));
break;
}
}
 else {
out.format("String_Node_Str");
}
out.println();
creader.consume();
}
}
Program: 111985
Project: 111985
Buggy source:
@Override public void startGroup(){
  if (DEBUG)   log("String_Node_Str");
  ++currentLevel;
  r[currentLevel]=r[currentLevel - 1];
  currentIndex[currentLevel]=0;
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void startGroup(){
  if (DEBUG)   log("String_Node_Str");
  ++currentLevel;
  r[currentLevel]=r[currentLevel - 1];
  int fieldsCount=((GroupColumnIO)currentColumnIO).getChildrenCount();
  fieldsWritten[currentLevel].reset(fieldsCount);
  if (DEBUG)   printState();
}
Program: 111986
Project: 111986
Buggy source:
@Override public void endMessage(){
  writeNullForMissingFields(((GroupColumnIO)currentColumnIO).getChildrenCount() - 1);
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endMessage(){
  writeNullForMissingFieldsAtCurrentLevel();
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}
Program: 111987
Project: 111987
Buggy source:
@Override public void startMessage(){
  if (DEBUG)   log("String_Node_Str");
  currentColumnIO=MessageColumnIO.this;
  r[0]=0;
  currentIndex[0]=0;
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void startMessage(){
  if (DEBUG)   log("String_Node_Str");
  currentColumnIO=MessageColumnIO.this;
  r[0]=0;
  int numberOfFieldsToVisit=((GroupColumnIO)currentColumnIO).getChildrenCount();
  fieldsWritten[0].reset(numberOfFieldsToVisit);
  if (DEBUG)   printState();
}
Program: 111988
Project: 111988
Buggy source:
@Override public void endGroup(){
  if (DEBUG)   log("String_Node_Str");
  emptyField=false;
  int lastIndex=((GroupColumnIO)currentColumnIO).getChildrenCount() - 1;
  writeNullForMissingFields(lastIndex);
  --currentLevel;
  setRepetitionLevel();
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endGroup(){
  if (DEBUG)   log("String_Node_Str");
  emptyField=false;
  writeNullForMissingFieldsAtCurrentLevel();
  --currentLevel;
  setRepetitionLevel();
  if (DEBUG)   printState();
}
Program: 111989
Project: 111989
Buggy source:
@Override public void endField(String field,int index){
  if (DEBUG)   log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
  currentColumnIO=currentColumnIO.getParent();
  if (emptyField) {
    throw new ParquetEncodingException("String_Node_Str");
  }
  currentIndex[currentLevel]=index + 1;
  r[currentLevel]=currentLevel == 0 ? 0 : r[currentLevel - 1];
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endField(String field,int index){
  if (DEBUG)   log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
  currentColumnIO=currentColumnIO.getParent();
  if (emptyField) {
    throw new ParquetEncodingException("String_Node_Str");
  }
  fieldsWritten[currentLevel].markWritten(index);
  r[currentLevel]=currentLevel == 0 ? 0 : r[currentLevel - 1];
  if (DEBUG)   printState();
}
Program: 111990
Project: 111990
Buggy source:
@Override public void startField(String field,int index){
  try {
    if (DEBUG)     log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
    writeNullForMissingFields(index - 1);
    currentColumnIO=((GroupColumnIO)currentColumnIO).getChild(index);
    currentIndex[currentLevel]=index;
    emptyField=true;
    if (DEBUG)     printState();
  }
 catch (  RuntimeException e) {
    throw new ParquetEncodingException("String_Node_Str" + field + "String_Node_Str"+ index,e);
  }
}

Fixed version (ground truth):
@Override public void startField(String field,int index){
  try {
    if (DEBUG)     log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
    currentColumnIO=((GroupColumnIO)currentColumnIO).getChild(index);
    emptyField=true;
    if (DEBUG)     printState();
  }
 catch (  RuntimeException e) {
    throw new ParquetEncodingException("String_Node_Str" + field + "String_Node_Str"+ index,e);
  }
}
Program: 111991
Project: 111991
Buggy source:
public void printState(){
  log(currentLevel + "String_Node_Str" + currentIndex[currentLevel]+ "String_Node_Str"+ Arrays.toString(currentColumnIO.getFieldPath())+ "String_Node_Str"+ r[currentLevel]);
  if (r[currentLevel] > currentColumnIO.getRepetitionLevel()) {
    throw new InvalidRecordException(r[currentLevel] + "String_Node_Str" + currentColumnIO.getRepetitionLevel()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void printState(){
  log(currentLevel + "String_Node_Str" + fieldsWritten[currentLevel]+ "String_Node_Str"+ Arrays.toString(currentColumnIO.getFieldPath())+ "String_Node_Str"+ r[currentLevel]);
  if (r[currentLevel] > currentColumnIO.getRepetitionLevel()) {
    throw new InvalidRecordException(r[currentLevel] + "String_Node_Str" + currentColumnIO.getRepetitionLevel()+ "String_Node_Str");
  }
}
Program: 111992
Project: 111992
Buggy source:
public MessageColumnIORecordConsumer(ColumnWriteStore columns){
  int maxDepth=0;
  this.columnWriter=new ColumnWriter[MessageColumnIO.this.getLeaves().size()];
  for (  PrimitiveColumnIO primitiveColumnIO : MessageColumnIO.this.getLeaves()) {
    maxDepth=Math.max(maxDepth,primitiveColumnIO.getFieldPath().length);
    columnWriter[primitiveColumnIO.getId()]=columns.getColumnWriter(primitiveColumnIO.getColumnDescriptor());
  }
  currentIndex=new int[maxDepth];
  r=new int[maxDepth];
}

Fixed version (ground truth):
public MessageColumnIORecordConsumer(ColumnWriteStore columns){
  int maxDepth=0;
  this.columnWriter=new ColumnWriter[MessageColumnIO.this.getLeaves().size()];
  for (  PrimitiveColumnIO primitiveColumnIO : MessageColumnIO.this.getLeaves()) {
    maxDepth=Math.max(maxDepth,primitiveColumnIO.getFieldPath().length);
    columnWriter[primitiveColumnIO.getId()]=columns.getColumnWriter(primitiveColumnIO.getColumnDescriptor());
  }
  fieldsWritten=new FieldsMarker[maxDepth];
  for (int i=0; i < maxDepth; i++) {
    fieldsWritten[i]=new FieldsMarker();
  }
  r=new int[maxDepth];
}
Program: 111993
Project: 111993
Buggy source:
@Override public void startGroup(){
  if (DEBUG)   log("String_Node_Str");
  ++currentLevel;
  r[currentLevel]=r[currentLevel - 1];
  currentIndex[currentLevel]=0;
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void startGroup(){
  if (DEBUG)   log("String_Node_Str");
  ++currentLevel;
  r[currentLevel]=r[currentLevel - 1];
  int fieldsCount=((GroupColumnIO)currentColumnIO).getChildrenCount();
  fieldsWritten[currentLevel].reset(fieldsCount);
  if (DEBUG)   printState();
}
Program: 111994
Project: 111994
Buggy source:
@Override public void endMessage(){
  writeNullForMissingFields(((GroupColumnIO)currentColumnIO).getChildrenCount() - 1);
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endMessage(){
  writeNullForMissingFieldsAtCurrentLevel();
  if (DEBUG)   log("String_Node_Str");
  if (DEBUG)   printState();
}
Program: 111995
Project: 111995
Buggy source:
@Override public void startMessage(){
  if (DEBUG)   log("String_Node_Str");
  currentColumnIO=MessageColumnIO.this;
  r[0]=0;
  currentIndex[0]=0;
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void startMessage(){
  if (DEBUG)   log("String_Node_Str");
  currentColumnIO=MessageColumnIO.this;
  r[0]=0;
  int numberOfFieldsToVisit=((GroupColumnIO)currentColumnIO).getChildrenCount();
  fieldsWritten[0].reset(numberOfFieldsToVisit);
  if (DEBUG)   printState();
}
Program: 111996
Project: 111996
Buggy source:
@Override public void endGroup(){
  if (DEBUG)   log("String_Node_Str");
  emptyField=false;
  int lastIndex=((GroupColumnIO)currentColumnIO).getChildrenCount() - 1;
  writeNullForMissingFields(lastIndex);
  --currentLevel;
  setRepetitionLevel();
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endGroup(){
  if (DEBUG)   log("String_Node_Str");
  emptyField=false;
  writeNullForMissingFieldsAtCurrentLevel();
  --currentLevel;
  setRepetitionLevel();
  if (DEBUG)   printState();
}
Program: 111997
Project: 111997
Buggy source:
@Override public void endField(String field,int index){
  if (DEBUG)   log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
  currentColumnIO=currentColumnIO.getParent();
  if (emptyField) {
    throw new ParquetEncodingException("String_Node_Str");
  }
  currentIndex[currentLevel]=index + 1;
  r[currentLevel]=currentLevel == 0 ? 0 : r[currentLevel - 1];
  if (DEBUG)   printState();
}

Fixed version (ground truth):
@Override public void endField(String field,int index){
  if (DEBUG)   log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
  currentColumnIO=currentColumnIO.getParent();
  if (emptyField) {
    throw new ParquetEncodingException("String_Node_Str");
  }
  fieldsWritten[currentLevel].markWritten(index);
  r[currentLevel]=currentLevel == 0 ? 0 : r[currentLevel - 1];
  if (DEBUG)   printState();
}
Program: 111998
Project: 111998
Buggy source:
@Override public void startField(String field,int index){
  try {
    if (DEBUG)     log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
    writeNullForMissingFields(index - 1);
    currentColumnIO=((GroupColumnIO)currentColumnIO).getChild(index);
    currentIndex[currentLevel]=index;
    emptyField=true;
    if (DEBUG)     printState();
  }
 catch (  RuntimeException e) {
    throw new ParquetEncodingException("String_Node_Str" + field + "String_Node_Str"+ index,e);
  }
}

Fixed version (ground truth):
@Override public void startField(String field,int index){
  try {
    if (DEBUG)     log("String_Node_Str" + field + "String_Node_Str"+ index+ "String_Node_Str");
    currentColumnIO=((GroupColumnIO)currentColumnIO).getChild(index);
    emptyField=true;
    if (DEBUG)     printState();
  }
 catch (  RuntimeException e) {
    throw new ParquetEncodingException("String_Node_Str" + field + "String_Node_Str"+ index,e);
  }
}
Program: 111999
Project: 111999
Buggy source:
public void printState(){
  log(currentLevel + "String_Node_Str" + currentIndex[currentLevel]+ "String_Node_Str"+ Arrays.toString(currentColumnIO.getFieldPath())+ "String_Node_Str"+ r[currentLevel]);
  if (r[currentLevel] > currentColumnIO.getRepetitionLevel()) {
    throw new InvalidRecordException(r[currentLevel] + "String_Node_Str" + currentColumnIO.getRepetitionLevel()+ "String_Node_Str");
  }
}

Fixed version (ground truth):
public void printState(){
  log(currentLevel + "String_Node_Str" + fieldsWritten[currentLevel]+ "String_Node_Str"+ Arrays.toString(currentColumnIO.getFieldPath())+ "String_Node_Str"+ r[currentLevel]);
  if (r[currentLevel] > currentColumnIO.getRepetitionLevel()) {
    throw new InvalidRecordException(r[currentLevel] + "String_Node_Str" + currentColumnIO.getRepetitionLevel()+ "String_Node_Str");
  }
}
Program: 112000
Project: 112000
Buggy source:
public MessageColumnIORecordConsumer(ColumnWriteStore columns){
  int maxDepth=0;
  this.columnWriter=new ColumnWriter[MessageColumnIO.this.getLeaves().size()];
  for (  PrimitiveColumnIO primitiveColumnIO : MessageColumnIO.this.getLeaves()) {
    maxDepth=Math.max(maxDepth,primitiveColumnIO.getFieldPath().length);
    columnWriter[primitiveColumnIO.getId()]=columns.getColumnWriter(primitiveColumnIO.getColumnDescriptor());
  }
  currentIndex=new int[maxDepth];
  r=new int[maxDepth];
}

Fixed version (ground truth):
public MessageColumnIORecordConsumer(ColumnWriteStore columns){
  int maxDepth=0;
  this.columnWriter=new ColumnWriter[MessageColumnIO.this.getLeaves().size()];
  for (  PrimitiveColumnIO primitiveColumnIO : MessageColumnIO.this.getLeaves()) {
    maxDepth=Math.max(maxDepth,primitiveColumnIO.getFieldPath().length);
    columnWriter[primitiveColumnIO.getId()]=columns.getColumnWriter(primitiveColumnIO.getColumnDescriptor());
  }
  fieldsWritten=new FieldsMarker[maxDepth];
  for (int i=0; i < maxDepth; i++) {
    fieldsWritten[i]=new FieldsMarker();
  }
  r=new int[maxDepth];
}
Program: 112001
Project: 112001
Buggy source:
@Override public long getLength(){
  if (realSplit == null) {
    return 0;
  }
 else {
    try {
      return realSplit.getLength();
    }
 catch (    IOException ex) {
      throw new RuntimeException("String_Node_Str" + realSplit,ex);
    }
catch (    InterruptedException ex) {
      throw new RuntimeException("String_Node_Str" + realSplit,ex);
    }
  }
}

Fixed version (ground truth):
@Override public long getLength(){
  if (realSplit == null) {
    return 0;
  }
 else {
    return realSplit.getLength();
  }
}
Program: 112002
Project: 112002
Buggy source:
@Override public String[] getLocations() throws IOException {
  try {
    return realSplit.getLocations();
  }
 catch (  final InterruptedException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
@Override public String[] getLocations() throws IOException {
  return realSplit.getLocations();
}
Program: 112003
Project: 112003
Buggy source:
/** 
 * In thrift enum values are written as ints, this method checks if the enum index is defined.
 * @param expectedType
 * @param i
 */
private void checkEnum(ThriftType expectedType,int i){
  if (expectedType.getType() == ThriftTypeID.ENUM) {
    List<ThriftType.EnumValue> enumValues=((ThriftType.EnumType)expectedType).getValues();
    if (i >= enumValues.size() || enumValues.get(i) == null)     throw new DecodingSchemaMismatchException("String_Node_Str" + i + "String_Node_Str"+ expectedType);
  }
}

Fixed version (ground truth):
/** 
 * In thrift enum values are written as ints, this method checks if the enum index is defined.
 * @param expectedType
 * @param i
 */
private void checkEnum(ThriftType expectedType,int i){
  if (expectedType.getType() == ThriftTypeID.ENUM) {
    ThriftType.EnumType expectedEnumType=(ThriftType.EnumType)expectedType;
    if (expectedEnumType.getEnumValueById(i) == null) {
      throw new DecodingSchemaMismatchException("String_Node_Str" + i + "String_Node_Str"+ expectedType);
    }
  }
}
Program: 112004
Project: 112004
Buggy source:
public EnumWriteProtocol(PrimitiveColumnIO columnIO,EnumType type,Events returnClause){
  super(returnClause);
  for (  EnumValue enumValue : type.getValues()) {
    enumLookup.put(enumValue.getId(),Binary.fromString(enumValue.getName()));
  }
  this.columnIO=columnIO;
}

Fixed version (ground truth):
public EnumWriteProtocol(PrimitiveColumnIO columnIO,EnumType type,Events returnClause){
  super(returnClause);
  this.columnIO=columnIO;
  this.type=type;
}
Program: 112005
Project: 112005
Buggy source:
public FieldEnumConverter(List<TProtocol> events,ThriftField field){
  this.events=events;
  final List<EnumValue> values=((EnumType)field.getType()).getValues();
  for (  EnumValue enumValue : values) {
    enumLookup.put(Binary.fromString(enumValue.getName()),enumValue.getId());
  }
}

Fixed version (ground truth):
public FieldEnumConverter(List<TProtocol> events,ThriftField field){
  this.events=events;
  final Iterable<EnumValue> values=((EnumType)field.getType()).getValues();
  for (  EnumValue enumValue : values) {
    enumLookup.put(Binary.fromString(enumValue.getName()),enumValue.getId());
  }
}
Program: 112006
Project: 112006
Buggy source:
public List<EnumValue> getValues(){
  return values;
}

Fixed version (ground truth):
public Iterable<EnumValue> getValues(){
  return new Iterable<EnumValue>(){
    @Override public Iterator<EnumValue> iterator(){
      return values.iterator();
    }
  }
;
}