nus-yam/ex-repair huggingface dataset:
Program: 63301
Project: 63301
Buggy source:
protected List<String> submitJob(String cubename,long startDate,long endDate,CubeBuildTypeEnum jobType) throws SchedulerException, IOException, InvalidJobInstanceException, CubeIntegrityException {
  List<String> jobList=new ArrayList<String>();
  CubeManager cubeMgr=CubeManager.getInstance(KylinConfig.getInstanceFromEnv());
  CubeInstance cube=cubeMgr.getCube(cubename);
  CubeManager.getInstance(this.getTestConfig()).loadCubeCache(cube);
  System.out.println(JsonUtil.writeValueAsIndentString(cube));
  List<CubeSegment> newSegments=cubeMgr.allocateSegments(cube,jobType,startDate,endDate);
  System.out.println(JsonUtil.writeValueAsIndentString(cube));
  for (  CubeSegment seg : newSegments) {
    JobInstance newJob=jobManager.createJob(cubename,seg.getName(),UUID.randomUUID().toString(),jobType);
    String jobUuid=jobManager.submitJob(newJob);
    jobList.add(jobUuid);
  }
  return jobList;
}

Fixed version (ground truth):
protected List<String> submitJob(String cubename,long startDate,long endDate,CubeBuildTypeEnum jobType) throws SchedulerException, IOException, InvalidJobInstanceException, CubeIntegrityException {
  CubeManager cubeMgr=CubeManager.getInstance(KylinConfig.getInstanceFromEnv());
  CubeInstance cube=cubeMgr.getCube(cubename);
  CubeManager.getInstance(this.getTestConfig()).loadCubeCache(cube);
  System.out.println(JsonUtil.writeValueAsIndentString(cube));
  List<CubeSegment> newSegments=cubeMgr.allocateSegments(cube,jobType,startDate,endDate);
  System.out.println(JsonUtil.writeValueAsIndentString(cube));
  List<String> jobUuids=Lists.newArrayList();
  List<JobInstance> jobs=Lists.newArrayList();
  for (  CubeSegment seg : newSegments) {
    String uuid=seg.getUuid();
    seg.setLastBuildJobID(uuid);
    jobUuids.add(uuid);
    jobs.add(jobManager.createJob(cubename,seg.getName(),uuid,jobType));
  }
  cubeMgr.updateCube(cube);
  for (  JobInstance job : jobs) {
    jobManager.submitJob(job);
  }
  return jobUuids;
}
Program: 63302
Project: 63302
Buggy source:
public CubeInstance createCubeAndDesc(String cubeName,String projectName,CubeDesc desc) throws IOException {
  if (getCubeManager().getCube(cubeName) != null) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str");
  }
  String owner=SecurityContextHolder.getContext().getAuthentication().getName();
  CubeDesc createdDesc=null;
  CubeInstance createdCube=null;
  createdDesc=getMetadataManager().createCubeDesc(desc);
  if (!createdDesc.getError().isEmpty()) {
    throw new InternalErrorException(createdDesc.getError().get(0));
  }
  int cuboidCount=CuboidCLI.simulateCuboidGeneration(createdDesc);
  logger.info("String_Node_Str" + cubeName + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
  createdCube=getCubeManager().createCube(cubeName,projectName,createdDesc,owner);
  accessService.init(createdCube,AclPermission.ADMINISTRATION);
  ProjectInstance project=getProjectManager().getProject(projectName);
  accessService.inherit(createdCube,project);
  return createdCube;
}

Fixed version (ground truth):
public CubeInstance createCubeAndDesc(String cubeName,String projectName,CubeDesc desc) throws IOException {
  if (getCubeManager().getCube(cubeName) != null) {
    throw new InternalErrorException("String_Node_Str" + cubeName + "String_Node_Str");
  }
  String owner=SecurityContextHolder.getContext().getAuthentication().getName();
  CubeDesc createdDesc=null;
  CubeInstance createdCube=null;
  createdDesc=getMetadataManager().createCubeDesc(desc);
  if (!createdDesc.getError().isEmpty()) {
    getMetadataManager().removeCubeDesc(createdDesc);
    throw new InternalErrorException(createdDesc.getError().get(0));
  }
  try {
    int cuboidCount=CuboidCLI.simulateCuboidGeneration(createdDesc);
    logger.info("String_Node_Str" + cubeName + "String_Node_Str"+ cuboidCount+ "String_Node_Str");
  }
 catch (  Exception e) {
    getMetadataManager().removeCubeDesc(createdDesc);
    throw new InternalErrorException("String_Node_Str",e);
  }
  createdCube=getCubeManager().createCube(cubeName,projectName,createdDesc,owner);
  accessService.init(createdCube,AclPermission.ADMINISTRATION);
  ProjectInstance project=getProjectManager().getProject(projectName);
  accessService.inherit(createdCube,project);
  return createdCube;
}
Program: 63303
Project: 63303
Buggy source:
public List<CubeSegment> getSegments(CubeSegmentStatusEnum status){
  List<CubeSegment> segments=new ArrayList<CubeSegment>();
  for (  CubeSegment segment : segments) {
    if (segment.getStatus() == status) {
      segments.add(segment);
    }
  }
  return segments;
}

Fixed version (ground truth):
public List<CubeSegment> getSegments(CubeSegmentStatusEnum status){
  List<CubeSegment> result=new ArrayList<CubeSegment>();
  for (  CubeSegment segment : segments) {
    if (segment.getStatus() == status) {
      result.add(segment);
    }
  }
  return result;
}
Program: 63304
Project: 63304
Buggy source:
private static Pair<File,File> getJobJarFiles(){
  String version;
  try {
    MavenXpp3Reader pomReader=new MavenXpp3Reader();
    Model model=pomReader.read(new FileReader("String_Node_Str"));
    version=model.getVersion();
  }
 catch (  Exception e) {
    throw new RuntimeException(e.getMessage(),e);
  }
  String jobTargetDir="String_Node_Str";
  File jobJar=new File(jobTargetDir,"String_Node_Str" + version + "String_Node_Str");
  File coprocessorJar=new File(jobTargetDir,"String_Node_Str" + version + "String_Node_Str");
  return new Pair<File,File>(jobJar,coprocessorJar);
}

Fixed version (ground truth):
private static Pair<File,File> getJobJarFiles(){
  String version;
  try {
    MavenXpp3Reader pomReader=new MavenXpp3Reader();
    Model model=pomReader.read(new FileReader("String_Node_Str"));
    version=model.getVersion();
  }
 catch (  Exception e) {
    throw new RuntimeException(e.getMessage(),e);
  }
  File jobJar=new File("String_Node_Str","String_Node_Str" + version + "String_Node_Str");
  File coprocessorJar=new File("String_Node_Str","String_Node_Str" + version + "String_Node_Str");
  return new Pair<File,File>(jobJar,coprocessorJar);
}
Program: 63305
Project: 63305
Buggy source:
public static SRowAggregators fromValueDecoders(Collection<RowValueDecoder> rowValueDecoders){
  HCol[] hcols=new HCol[rowValueDecoders.size()];
  int i=0;
  for (  RowValueDecoder rowValueDecoder : rowValueDecoders) {
    hcols[i++]=buildHCol(rowValueDecoder);
  }
  SRowAggregators aggrs=new SRowAggregators(hcols);
  return aggrs;
}

Fixed version (ground truth):
public static SRowAggregators fromValueDecoders(Collection<RowValueDecoder> rowValueDecoders){
  HCol[] hcols=new HCol[rowValueDecoders.size()];
  int i=0;
  for (  RowValueDecoder rowValueDecoder : rowValueDecoders) {
    hcols[i++]=buildHCol(rowValueDecoder.getHBaseColumn());
  }
  SRowAggregators aggrs=new SRowAggregators(hcols);
  return aggrs;
}
Program: 63306
Project: 63306
Buggy source:
private static HCol buildHCol(RowValueDecoder rowValueDecoder){
  HBaseColumnDesc desc=rowValueDecoder.getHBaseColumn();
  byte[] family=Bytes.toBytes(desc.getColumnFamilyName());
  byte[] qualifier=Bytes.toBytes(desc.getQualifier());
  MeasureDesc[] measures=desc.getMeasures();
  String[] funcNames=new String[measures.length];
  String[] dataTypes=new String[measures.length];
  for (int i=0; i < measures.length; i++) {
    funcNames[i]=measures[i].getFunction().getExpression();
    dataTypes[i]=measures[i].getFunction().getReturnType();
  }
  return new HCol(family,qualifier,funcNames,dataTypes);
}

Fixed version (ground truth):
private static HCol buildHCol(HBaseColumnDesc desc){
  byte[] family=Bytes.toBytes(desc.getColumnFamilyName());
  byte[] qualifier=Bytes.toBytes(desc.getQualifier());
  MeasureDesc[] measures=desc.getMeasures();
  String[] funcNames=new String[measures.length];
  String[] dataTypes=new String[measures.length];
  for (int i=0; i < measures.length; i++) {
    funcNames[i]=measures[i].getFunction().getExpression();
    dataTypes[i]=measures[i].getFunction().getReturnType();
  }
  return new HCol(family,qualifier,funcNames,dataTypes);
}
Program: 63307
Project: 63307
Buggy source:
@Override public boolean moveNext(){
  boolean hasNext=iterator.hasNext();
  if (hasNext) {
    String[] row=iterator.next();
    for (int i=0, n=colDescs.size(); i < n; i++) {
      ColumnDesc colDesc=colDescs.get(i);
      int colIdx=colDesc.getZeroBasedIndex();
      if (colIdx >= 0) {
        current[i]=Tuple.convertOptiqCellValue(row[colIdx],colDesc.getDatatype());
      }
 else {
        current[i]=null;
      }
    }
  }
  return hasNext;
}

Fixed version (ground truth):
@Override public boolean moveNext(){
  boolean hasNext=iterator.hasNext();
  if (hasNext) {
    String[] row=iterator.next();
    for (int i=0, n=colDescs.size(); i < n; i++) {
      ColumnDesc colDesc=colDescs.get(i);
      int colIdx=colDesc.getZeroBasedIndex();
      if (colIdx >= 0) {
        current[i]=Tuple.convertOptiqCellValue(row[colIdx],colDesc.getType().getName());
      }
 else {
        current[i]=null;
      }
    }
  }
  return hasNext;
}
Program: 63308
Project: 63308
Buggy source:
public String getSQLType(){
  if (isCountDistinct())   return "String_Node_Str";
 else   if (isSum() || isMax() || isMin())   return parameter.getColRefs().get(0).getDatatype();
 else   return returnType;
}

Fixed version (ground truth):
public String getSQLType(){
  if (isCountDistinct())   return "String_Node_Str";
 else   if (isSum() || isMax() || isMin())   return parameter.getColRefs().get(0).getType().getName();
 else   return returnType;
}
Program: 63309
Project: 63309
Buggy source:
public void setMeasureValue(String fieldName,Object fieldValue){
  String dataType=info.getDataType(fieldName);
  if ("String_Node_Str".equals(dataType) && fieldValue instanceof BigDecimal) {
    fieldValue=((BigDecimal)fieldValue).doubleValue();
  }
  setFieldObjectValue(fieldName,fieldValue);
}

Fixed version (ground truth):
public void setMeasureValue(String fieldName,Object fieldValue){
  String dataType=info.getDataType(fieldName);
  if ("String_Node_Str".equals(dataType) && fieldValue instanceof BigDecimal) {
    fieldValue=((BigDecimal)fieldValue).doubleValue();
  }
 else   if ("String_Node_Str".equals(dataType) && !(fieldValue instanceof Integer)) {
    fieldValue=((Number)fieldValue).intValue();
  }
  setFieldObjectValue(fieldName,fieldValue);
}
Program: 63310
Project: 63310
Buggy source:
public static void writeIntArray(int[] array,ByteBuffer out){
  if (array == null) {
    writeVInt(-1,out);
    return;
  }
  writeVInt(array.length,out);
  out.asIntBuffer().put(array);
}

Fixed version (ground truth):
public static void writeIntArray(int[] array,ByteBuffer out){
  if (array == null) {
    writeVInt(-1,out);
    return;
  }
  writeVInt(array.length,out);
  for (int i=0; i < array.length; ++i) {
    writeVInt(array[i],out);
  }
}
Program: 63311
Project: 63311
Buggy source:
public static int[] readIntArray(ByteBuffer in){
  int len=readVInt(in);
  if (len < 0)   return null;
  int[] array=new int[len];
  in.asIntBuffer().get(array);
  return array;
}

Fixed version (ground truth):
public static int[] readIntArray(ByteBuffer in){
  int len=readVInt(in);
  if (len < 0)   return null;
  int[] array=new int[len];
  for (int i=0; i < len; ++i) {
    array[i]=readVInt(in);
  }
  return array;
}
Program: 63312
Project: 63312
Buggy source:
@Test public void test(){
}

Fixed version (ground truth):
@Test public void test(){
  ByteBuffer buffer=ByteBuffer.allocate(10000);
  int[] x=new int[]{1,2,3};
  BytesUtil.writeIntArray(x,buffer);
  buffer.flip();
  byte[] buf=new byte[buffer.limit()];
  System.arraycopy(buffer.array(),0,buf,0,buffer.limit());
  ByteBuffer newBuffer=ByteBuffer.wrap(buf);
  int[] y=BytesUtil.readIntArray(newBuffer);
  assertEquals(y[2],3);
}
Program: 63313
Project: 63313
Buggy source:
public static void main(String[] args) throws Exception {
  int port=80;
  if (args.length >= 1) {
    port=Integer.parseInt(args[0]);
  }
  ClasspathUtil.addClasspath(new File("String_Node_Str").getAbsolutePath());
  ClasspathUtil.addClasspath(new File("String_Node_Str").getAbsolutePath());
  String webBase=new File("String_Node_Str").getAbsolutePath();
  String apiBase=new File("String_Node_Str").getAbsolutePath();
  Tomcat tomcat=new Tomcat();
  tomcat.setPort(port);
  tomcat.setBaseDir("String_Node_Str");
  StandardServer server=(StandardServer)tomcat.getServer();
  AprLifecycleListener listener=new AprLifecycleListener();
  server.addLifecycleListener(listener);
  tomcat.addWebapp("String_Node_Str",apiBase);
  Context webContext=tomcat.addWebapp("String_Node_Str",webBase);
  ErrorPage notFound=new ErrorPage();
  notFound.setErrorCode(404);
  notFound.setLocation("String_Node_Str");
  webContext.addErrorPage(notFound);
  webContext.addWelcomeFile("String_Node_Str");
  tomcat.start();
  tomcat.getServer().await();
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  int port=9080;
  if (args.length >= 1) {
    port=Integer.parseInt(args[0]);
  }
  ClasspathUtil.addClasspath(new File("String_Node_Str").getAbsolutePath());
  ClasspathUtil.addClasspath(new File("String_Node_Str").getAbsolutePath());
  String webBase=new File("String_Node_Str").getAbsolutePath();
  String apiBase=new File("String_Node_Str").getAbsolutePath();
  Tomcat tomcat=new Tomcat();
  tomcat.setPort(port);
  tomcat.setBaseDir("String_Node_Str");
  StandardServer server=(StandardServer)tomcat.getServer();
  AprLifecycleListener listener=new AprLifecycleListener();
  server.addLifecycleListener(listener);
  tomcat.addWebapp("String_Node_Str",apiBase);
  Context webContext=tomcat.addWebapp("String_Node_Str",webBase);
  ErrorPage notFound=new ErrorPage();
  notFound.setErrorCode(404);
  notFound.setLocation("String_Node_Str");
  webContext.addErrorPage(notFound);
  webContext.addWelcomeFile("String_Node_Str");
  tomcat.start();
  tomcat.getServer().await();
}
Program: 63314
Project: 63314
Buggy source:
private String wrapExecCmd(JobInstance job,String cmd,String suffix){
  if (StringUtils.isBlank(cmd))   return cmd;
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  try {
    FileUtils.forceMkdir(new File(config.getKylinJobLogDir()));
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + config.getKylinJobLogDir() + "String_Node_Str",e);
  }
  String log=config.getKylinJobLogDir() + "String_Node_Str" + job.getUuid()+ "String_Node_Str"+ suffix+ "String_Node_Str";
  return "String_Node_Str" + cmd + "String_Node_Str"+ log;
}

Fixed version (ground truth):
private String wrapExecCmd(JobInstance job,String cmd,String suffix){
  if (StringUtils.isBlank(cmd))   return cmd;
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  try {
    FileUtils.forceMkdir(new File(config.getKylinJobLogDir()));
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + config.getKylinJobLogDir() + "String_Node_Str",e);
  }
  String log=config.getKylinJobLogDir() + "String_Node_Str" + job.getUuid()+ "String_Node_Str"+ suffix+ "String_Node_Str";
  String mkLogDir="String_Node_Str" + config.getKylinJobLogDir();
  return mkLogDir + "String_Node_Str" + "String_Node_Str"+ cmd+ "String_Node_Str"+ log;
}
Program: 63315
Project: 63315
Buggy source:
@Override public Iterator<TableRecordBytes> iterator(){
  return new Iterator<TableRecordBytes>(){
    int i=0;
    TableRecord rec=new TableRecord(info);
    ImmutableBytesWritable temp=new ImmutableBytesWritable();
    @Override public boolean hasNext(){
      return i < nRecords;
    }
    @Override public TableRecordBytes next(){
      for (int col=0; col < nColumns; col++) {
        containers[col].getValueAt(i,temp);
        rec.setValueBytes(col,temp);
      }
      i++;
      return rec;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<TableRecordBytes> iterator(){
  return new Iterator<TableRecordBytes>(){
    int i=0;
    TableRecordBytes rec=info.createTableRecord();
    ImmutableBytesWritable temp=new ImmutableBytesWritable();
    @Override public boolean hasNext(){
      return i < nRecords;
    }
    @Override public TableRecordBytes next(){
      for (int col=0; col < nColumns; col++) {
        containers[col].getValueAt(i,temp);
        rec.setValueBytes(col,temp);
      }
      i++;
      return rec;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 63316
Project: 63316
Buggy source:
@Override public Pair<ImmutableBytesWritable,ImmutableBytesWritable> next(){
  if (hasNext()) {
    try {
      hasMore=innerScaner.nextRaw(results);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (results.size() < 1)     throw new IllegalStateException("String_Node_Str");
    Cell c=results.get(0);
    key.set(c.getRowArray(),c.getRowOffset(),c.getRowLength());
    value.set(c.getValueArray(),c.getValueOffset(),c.getValueLength());
    return pair;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public Pair<ImmutableBytesWritable,ImmutableBytesWritable> next(){
  if (hasNext()) {
    try {
      hasMore=innerScaner.nextRaw(results);
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (results.size() < 1)     throw new IllegalStateException("String_Node_Str");
    Cell c=results.get(0);
    key.set(c.getRowArray(),c.getRowOffset(),c.getRowLength());
    value.set(c.getValueArray(),c.getValueOffset(),c.getValueLength());
    results.clear();
    return pair;
  }
 else {
    return null;
  }
}
Program: 63317
Project: 63317
Buggy source:
@Override public Iterator<Pair<ImmutableBytesWritable,ImmutableBytesWritable>> iterator(){
  return new Iterator<Pair<ImmutableBytesWritable,ImmutableBytesWritable>>(){
    ImmutableBytesWritable key=new ImmutableBytesWritable();
    ImmutableBytesWritable value=new ImmutableBytesWritable();
    Pair<ImmutableBytesWritable,ImmutableBytesWritable> pair=new Pair<>(key,value);
    private boolean hasMore=true;
    @Override public boolean hasNext(){
      return hasMore;
    }
    @Override public Pair<ImmutableBytesWritable,ImmutableBytesWritable> next(){
      if (hasNext()) {
        try {
          hasMore=innerScaner.nextRaw(results);
        }
 catch (        IOException e) {
          throw new RuntimeException(e);
        }
        if (results.size() < 1)         throw new IllegalStateException("String_Node_Str");
        Cell c=results.get(0);
        key.set(c.getRowArray(),c.getRowOffset(),c.getRowLength());
        value.set(c.getValueArray(),c.getValueOffset(),c.getValueLength());
        return pair;
      }
 else {
        return null;
      }
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<Pair<ImmutableBytesWritable,ImmutableBytesWritable>> iterator(){
  return new Iterator<Pair<ImmutableBytesWritable,ImmutableBytesWritable>>(){
    ImmutableBytesWritable key=new ImmutableBytesWritable();
    ImmutableBytesWritable value=new ImmutableBytesWritable();
    Pair<ImmutableBytesWritable,ImmutableBytesWritable> pair=new Pair<>(key,value);
    private boolean hasMore=true;
    @Override public boolean hasNext(){
      return hasMore;
    }
    @Override public Pair<ImmutableBytesWritable,ImmutableBytesWritable> next(){
      if (hasNext()) {
        try {
          hasMore=innerScaner.nextRaw(results);
        }
 catch (        IOException e) {
          throw new RuntimeException(e);
        }
        if (results.size() < 1)         throw new IllegalStateException("String_Node_Str");
        Cell c=results.get(0);
        key.set(c.getRowArray(),c.getRowOffset(),c.getRowLength());
        value.set(c.getValueArray(),c.getValueOffset(),c.getValueLength());
        results.clear();
        return pair;
      }
 else {
        return null;
      }
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 63318
Project: 63318
Buggy source:
private static List<String> extractTables(String database,BufferedReader reader,File metaTmpDir) throws IOException {
  File tableDescDir=new File(metaTmpDir,TABLE_FOLDER_NAME);
  File tableExdDir=new File(metaTmpDir,TABLE_EXD_FOLDER_NAME);
  mkdirs(tableDescDir);
  mkdirs(tableExdDir);
  List<TableDesc> tableDescList=new ArrayList<TableDesc>();
  List<Map<String,String>> tableAttrsList=new ArrayList<Map<String,String>>();
  getTables(database,reader,tableDescList,tableAttrsList);
  List<String> loadedTables=Lists.newArrayList();
  for (  TableDesc table : tableDescList) {
    File file=new File(tableDescDir,table.getName().toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),table);
    loadedTables.add(table.getName());
  }
  for (  Map<String,String> tableAttrs : tableAttrsList) {
    File file=new File(tableExdDir,tableAttrs.get("String_Node_Str").toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),tableAttrs);
  }
  return loadedTables;
}

Fixed version (ground truth):
private static List<String> extractTables(String database,BufferedReader reader,File metaTmpDir) throws IOException {
  File tableDescDir=new File(metaTmpDir,TABLE_FOLDER_NAME);
  File tableExdDir=new File(metaTmpDir,TABLE_EXD_FOLDER_NAME);
  mkdirs(tableDescDir);
  mkdirs(tableExdDir);
  List<TableDesc> tableDescList=new ArrayList<TableDesc>();
  List<Map<String,String>> tableAttrsList=new ArrayList<Map<String,String>>();
  getTables(database,reader,tableDescList,tableAttrsList);
  List<String> loadedTables=Lists.newArrayList();
  for (  TableDesc table : tableDescList) {
    File file=new File(tableDescDir,table.getName().toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),table);
    loadedTables.add(table.getDatabase() + "String_Node_Str" + table.getName());
  }
  for (  Map<String,String> tableAttrs : tableAttrsList) {
    File file=new File(tableExdDir,tableAttrs.get("String_Node_Str").toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),tableAttrs);
  }
  return loadedTables;
}
Program: 63319
Project: 63319
Buggy source:
public static Set<String> reloadHiveTables(String[] hiveTables,KylinConfig config) throws IOException {
  Map<String,Set<String>> db2tables=Maps.newHashMap();
  for (  String table : hiveTables) {
    int cut=table.indexOf('.');
    String database=cut >= 0 ? table.substring(0,cut).trim() : "String_Node_Str";
    String tableName=cut >= 0 ? table.substring(cut + 1).trim() : table.trim();
    Set<String> set=db2tables.get(database);
    if (set == null) {
      set=Sets.newHashSet();
      db2tables.put(database,set);
    }
    set.add(tableName);
  }
  File metaTmpDir=File.createTempFile("String_Node_Str",null);
  metaTmpDir.delete();
  metaTmpDir.mkdirs();
  Set<String> loadedTables=Sets.newHashSet();
  for (  String database : db2tables.keySet()) {
    List<String> loaded=extractHiveTables(database,db2tables.get(database),metaTmpDir,config);
    for (    String tableName : loaded) {
      loadedTables.add(database + tableName);
    }
  }
  ResourceTool.copy(KylinConfig.createInstanceFromUri(metaTmpDir.getAbsolutePath()),config);
  return loadedTables;
}

Fixed version (ground truth):
public static Set<String> reloadHiveTables(String[] hiveTables,KylinConfig config) throws IOException {
  Map<String,Set<String>> db2tables=Maps.newHashMap();
  for (  String table : hiveTables) {
    int cut=table.indexOf('.');
    String database=cut >= 0 ? table.substring(0,cut).trim() : "String_Node_Str";
    String tableName=cut >= 0 ? table.substring(cut + 1).trim() : table.trim();
    Set<String> set=db2tables.get(database);
    if (set == null) {
      set=Sets.newHashSet();
      db2tables.put(database,set);
    }
    set.add(tableName);
  }
  File metaTmpDir=File.createTempFile("String_Node_Str",null);
  metaTmpDir.delete();
  metaTmpDir.mkdirs();
  Set<String> loadedTables=Sets.newHashSet();
  for (  String database : db2tables.keySet()) {
    List<String> loaded=extractHiveTables(database,db2tables.get(database),metaTmpDir,config);
    loadedTables.addAll(loaded);
  }
  ResourceTool.copy(KylinConfig.createInstanceFromUri(metaTmpDir.getAbsolutePath()),config);
  return loadedTables;
}
Program: 63320
Project: 63320
Buggy source:
public Set<String> getTables(){
  return tables == null ? new TreeSet<String>() : tables;
}

Fixed version (ground truth):
public Set<String> getTables(){
  tables=tables == null ? new TreeSet<String>() : tables;
  return tables;
}
Program: 63321
Project: 63321
Buggy source:
public List<JobStep> buildSteps(JobInstance jobInstance) throws IOException {
  init(jobInstance);
switch (jobInstance.getType()) {
case BUILD:
    return buildCreateBuildCubeSegmentSteps(jobInstance);
case MERGE:
  return buildCreateMergeCubeSegmentsSteps(jobInstance);
default :
throw new IllegalArgumentException("String_Node_Str" + jobInstance.getType() + "String_Node_Str");
}
}

Fixed version (ground truth):
public List<JobStep> buildSteps(JobInstance jobInstance) throws IOException {
  init(jobInstance);
switch (jobInstance.getType()) {
case BUILD:
    return createBuildCubeSegmentSteps(jobInstance);
case MERGE:
  return createMergeCubeSegmentsSteps(jobInstance);
default :
throw new IllegalArgumentException("String_Node_Str" + jobInstance.getType() + "String_Node_Str");
}
}
Program: 63322
Project: 63322
Buggy source:
public void updateJobInstance(JobInstance jobInstance) throws IOException {
  JobInstance updatedJob=null;
  try {
    updatedJob=getJob(jobInstance.getUuid());
    if (updatedJob == null) {
      saveJob(jobInstance);
      return;
    }
    updatedJob.setExecEndTime(jobInstance.getExecEndTime());
    updatedJob.setExecStartTime(jobInstance.getExecStartTime());
    updatedJob.setDuration(jobInstance.getDuration());
    updatedJob.setMrWaiting(jobInstance.getMrWaiting());
    updatedJob.setRelatedCube(jobInstance.getRelatedCube());
    updatedJob.setRelatedSegment(jobInstance.getRelatedSegment());
    updatedJob.setType(jobInstance.getType());
    updatedJob.clearSteps();
    updatedJob.addSteps(jobInstance.getSteps());
    saveJob(updatedJob);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage(),e);
    throw e;
  }
}

Fixed version (ground truth):
public void updateJobInstance(JobInstance jobInstance) throws IOException {
  try {
    JobInstance updatedJob=getJob(jobInstance.getUuid());
    if (updatedJob == null) {
      saveJob(jobInstance);
      return;
    }
    updatedJob.setExecEndTime(jobInstance.getExecEndTime());
    updatedJob.setExecStartTime(jobInstance.getExecStartTime());
    updatedJob.setDuration(jobInstance.getDuration());
    updatedJob.setMrWaiting(jobInstance.getMrWaiting());
    updatedJob.setRelatedCube(jobInstance.getRelatedCube());
    updatedJob.setRelatedSegment(jobInstance.getRelatedSegment());
    updatedJob.setType(jobInstance.getType());
    updatedJob.clearSteps();
    updatedJob.addSteps(jobInstance.getSteps());
    saveJob(updatedJob);
  }
 catch (  IOException e) {
    log.error(e.getLocalizedMessage(),e);
    throw e;
  }
}
Program: 63323
Project: 63323
Buggy source:
List<JobStep> getSteps(){
  if (steps == null) {
    steps=Lists.newArrayList();
  }
  return steps;
}

Fixed version (ground truth):
public List<JobStep> getSteps(){
  if (steps == null) {
    steps=Lists.newArrayList();
  }
  return steps;
}
Program: 63324
Project: 63324
Buggy source:
private static void undo(Opt opt) throws IOException, InterruptedException {
  logger.info("String_Node_Str" + opt.toString());
switch (opt.type) {
case CHANGE_HTABLE_HOST:
{
      String tableName=(String)opt.params[0];
      HTableDescriptor desc=hbaseAdmin.getTableDescriptor(TableName.valueOf(tableName));
      hbaseAdmin.disableTable(tableName);
      desc.setValue(CubeManager.getHtableMetadataKey(),dstConfig.getMetadataUrlPrefix());
      hbaseAdmin.modifyTable(tableName,desc);
      hbaseAdmin.enableTable(tableName);
    }
case COPY_FILE_IN_META:
{
    logger.info("String_Node_Str");
    break;
  }
case COPY_DICT_OR_SNAPSHOT:
{
  logger.info("String_Node_Str");
  break;
}
case RENAME_FOLDER_IN_HDFS:
{
String srcPath=(String)opt.params[1];
String dstPath=(String)opt.params[0];
if (hdfsFS.exists(new Path(srcPath)) && !hdfsFS.exists(new Path(dstPath))) {
  hdfsFS.rename(new Path(srcPath),new Path(dstPath));
  logger.info("String_Node_Str" + srcPath + "String_Node_Str"+ dstPath);
}
break;
}
case ADD_INTO_PROJECT:
{
logger.info("String_Node_Str");
break;
}
}
}

Fixed version (ground truth):
private static void undo(Opt opt) throws IOException, InterruptedException {
  logger.info("String_Node_Str" + opt.toString());
switch (opt.type) {
case CHANGE_HTABLE_HOST:
{
      String tableName=(String)opt.params[0];
      HTableDescriptor desc=hbaseAdmin.getTableDescriptor(TableName.valueOf(tableName));
      hbaseAdmin.disableTable(tableName);
      desc.setValue(CubeManager.getHtableMetadataKey(),srcConfig.getMetadataUrlPrefix());
      hbaseAdmin.modifyTable(tableName,desc);
      hbaseAdmin.enableTable(tableName);
    }
case COPY_FILE_IN_META:
{
    logger.info("String_Node_Str");
    break;
  }
case COPY_DICT_OR_SNAPSHOT:
{
  logger.info("String_Node_Str");
  break;
}
case RENAME_FOLDER_IN_HDFS:
{
String srcPath=(String)opt.params[1];
String dstPath=(String)opt.params[0];
if (hdfsFS.exists(new Path(srcPath)) && !hdfsFS.exists(new Path(dstPath))) {
  hdfsFS.rename(new Path(srcPath),new Path(dstPath));
  logger.info("String_Node_Str" + srcPath + "String_Node_Str"+ dstPath);
}
break;
}
case ADD_INTO_PROJECT:
{
logger.info("String_Node_Str");
break;
}
}
}
Program: 63325
Project: 63325
Buggy source:
@SuppressWarnings("String_Node_Str") public Cursor createCursor(AvaticaResultSet resultSet){
  KylinPrepare.PrepareResult result=((KylinResultSet)resultSet).getPrepareResult();
  return result.createCursor();
}

Fixed version (ground truth):
public Cursor createCursor(AvaticaResultSet resultSet){
  if (!(resultSet instanceof KylinResultSet))   throw new IllegalStateException("String_Node_Str");
  KylinPrepare.PrepareResult result=((KylinResultSet)resultSet).getPrepareResult();
  return result.createCursor();
}
Program: 63326
Project: 63326
Buggy source:
@Override public Result implement(EnumerableRelImplementor implementor,Prefer pref){
  @SuppressWarnings("String_Node_Str") JavaImplementor javaImplementor=(JavaImplementor)implementor;
  int ctxId=this.context.id;
  if (javaImplementor.getParentContext() != null) {
    ctxId=javaImplementor.getParentContext().id;
  }
  PhysType physType=PhysTypeImpl.of(javaImplementor.getTypeFactory(),this.rowType,pref.preferArray());
  String execFunction=genExecFunc();
  return javaImplementor.result(physType,Blocks.toBlock(Expressions.call(table.getExpression(OLAPTable.class),execFunction,javaImplementor.getRootExpression(),Expressions.constant(ctxId))));
}

Fixed version (ground truth):
@Override public Result implement(EnumerableRelImplementor implementor,Prefer pref){
  if (!(implementor instanceof JavaImplementor))   throw new IllegalStateException("String_Node_Str");
  JavaImplementor javaImplementor=(JavaImplementor)implementor;
  int ctxId=this.context.id;
  if (javaImplementor.getParentContext() != null) {
    ctxId=javaImplementor.getParentContext().id;
  }
  PhysType physType=PhysTypeImpl.of(javaImplementor.getTypeFactory(),this.rowType,pref.preferArray());
  String execFunction=genExecFunc();
  return javaImplementor.result(physType,Blocks.toBlock(Expressions.call(table.getExpression(OLAPTable.class),execFunction,javaImplementor.getRootExpression(),Expressions.constant(ctxId))));
}
Program: 63327
Project: 63327
Buggy source:
/** 
 * Get Java Env info as string
 * @return
 */
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN) public String getEnv(){
  logger.debug("String_Node_Str");
  PropertiesConfiguration tempConfig=new PropertiesConfiguration();
  try {
    String content="String_Node_Str";
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    Map<String,String> env=System.getenv();
    for (    Map.Entry<String,String> entry : env.entrySet()) {
      tempConfig.addProperty(entry.getKey(),entry.getValue());
    }
    Properties properteis=System.getProperties();
    for (    Object propName : properteis.keySet()) {
      tempConfig.setProperty((String)propName,properteis.get(propName));
    }
    tempConfig.save(baos);
    content=baos.toString();
    return content;
  }
 catch (  ConfigurationException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Get Java Env info as string
 * @return
 */
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN) public String getEnv(){
  logger.debug("String_Node_Str");
  PropertiesConfiguration tempConfig=new PropertiesConfiguration();
  try {
    String content="String_Node_Str";
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    Map<String,String> env=System.getenv();
    for (    Map.Entry<String,String> entry : env.entrySet()) {
      tempConfig.addProperty(entry.getKey(),entry.getValue());
    }
    Properties proterties=System.getProperties();
    for (    Map.Entry<Object,Object> entry : proterties.entrySet()) {
      tempConfig.setProperty((String)entry.getKey(),entry.getValue());
    }
    tempConfig.save(baos);
    content=baos.toString();
    return content;
  }
 catch (  ConfigurationException e) {
    throw new InternalErrorException("String_Node_Str",e);
  }
}
Program: 63328
Project: 63328
Buggy source:
/** 
 * return null if no dictionary for given column
 */
public Dictionary<?> getDictionary(CubeSegment cubeSeg,TblColRef col){
  DictionaryInfo info=null;
  try {
    DictionaryManager dictMgr=getDictionaryManager();
    String dictResPath=cubeSeg.getDictResPath(col);
    if (dictResPath == null)     return null;
    info=dictMgr.getDictionaryInfo(dictResPath);
    if (info == null)     throw new IllegalStateException("String_Node_Str" + dictResPath + "String_Node_Str"+ cubeSeg.getName()+ "String_Node_Str"+ col);
  }
 catch (  IOException e) {
    throw new IllegalStateException("String_Node_Str" + cubeSeg.getName() + "String_Node_Str"+ col,e);
  }
  return info == null ? null : info.getDictionaryObject();
}

Fixed version (ground truth):
/** 
 * return null if no dictionary for given column
 */
public Dictionary<?> getDictionary(CubeSegment cubeSeg,TblColRef col){
  DictionaryInfo info=null;
  try {
    DictionaryManager dictMgr=getDictionaryManager();
    String dictResPath=cubeSeg.getDictResPath(col);
    if (dictResPath == null)     return null;
    info=dictMgr.getDictionaryInfo(dictResPath);
    if (info == null)     throw new IllegalStateException("String_Node_Str" + dictResPath + "String_Node_Str"+ cubeSeg.getName()+ "String_Node_Str"+ col);
  }
 catch (  IOException e) {
    throw new IllegalStateException("String_Node_Str" + cubeSeg.getName() + "String_Node_Str"+ col,e);
  }
  return info.getDictionaryObject();
}
Program: 63330
Project: 63330
Buggy source:
@Override public int compare(DimensionDesc o1,DimensionDesc o2){
  JoinDesc j1=o2.getJoin();
  JoinDesc j2=o1.getJoin();
  return new Integer(j1 != null ? j1.getPrimaryKey().length : 0).compareTo(j2 != null ? j2.getPrimaryKey().length : 0);
}

Fixed version (ground truth):
@Override public int compare(DimensionDesc o1,DimensionDesc o2){
  JoinDesc j1=o2.getJoin();
  JoinDesc j2=o1.getJoin();
  return Integer.compare(j1 != null ? j1.getPrimaryKey().length : 0,j2 != null ? j2.getPrimaryKey().length : 0);
}
Program: 63331
Project: 63331
Buggy source:
private void printColumnMappings(HashMap<String,String> factTableCol2LookupCol,HashSet<String> usedCols,HashSet<String> defaultColumns){
  System.out.println("String_Node_Str");
  System.out.format("String_Node_Str","String_Node_Str","String_Node_Str");
  System.out.println();
  System.out.println();
  for (  String key : factTableCol2LookupCol.keySet()) {
    System.out.format("String_Node_Str",key,factTableCol2LookupCol.get(key));
    System.out.println();
  }
  for (  String key : usedCols) {
    System.out.format("String_Node_Str",key,"String_Node_Str");
    System.out.println();
  }
  for (  String key : defaultColumns) {
    System.out.format("String_Node_Str",key,"String_Node_Str");
    System.out.println();
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println();
  System.out.println("String_Node_Str" + cubeName);
  System.out.println("String_Node_Str" + rowCount);
  System.out.println("String_Node_Str" + conflictRatio);
  System.out.println("String_Node_Str" + linkableRatio);
  System.out.println("String_Node_Str" + randomSeed);
  System.out.println();
  System.out.println("String_Node_Str" + this.unlinkableRowCount);
  System.out.println("String_Node_Str");
  System.out.println();
}

Fixed version (ground truth):
private void printColumnMappings(HashMap<String,String> factTableCol2LookupCol,HashSet<String> usedCols,HashSet<String> defaultColumns){
  System.out.println("String_Node_Str");
  System.out.format("String_Node_Str","String_Node_Str","String_Node_Str");
  System.out.println();
  System.out.println();
  for (  Map.Entry<String,String> entry : factTableCol2LookupCol.entrySet()) {
    System.out.format("String_Node_Str",entry.getKey(),entry.getValue());
    System.out.println();
  }
  for (  String key : usedCols) {
    System.out.format("String_Node_Str",key,"String_Node_Str");
    System.out.println();
  }
  for (  String key : defaultColumns) {
    System.out.format("String_Node_Str",key,"String_Node_Str");
    System.out.println();
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str");
  System.out.println();
  System.out.println("String_Node_Str" + cubeName);
  System.out.println("String_Node_Str" + rowCount);
  System.out.println("String_Node_Str" + conflictRatio);
  System.out.println("String_Node_Str" + linkableRatio);
  System.out.println("String_Node_Str" + randomSeed);
  System.out.println();
  System.out.println("String_Node_Str" + this.unlinkableRowCount);
  System.out.println("String_Node_Str");
  System.out.println();
}
Program: 63332
Project: 63332
Buggy source:
private List<DimensionDesc> getSortedDimentsionDescs(){
  List<DimensionDesc> dimensions=desc.getDimensions();
  Collections.sort(dimensions,new Comparator<DimensionDesc>(){
    @Override public int compare(    DimensionDesc o1,    DimensionDesc o2){
      JoinDesc j1=o2.getJoin();
      JoinDesc j2=o1.getJoin();
      return new Integer(j1 != null ? j1.getPrimaryKey().length : 0).compareTo(j2 != null ? j2.getPrimaryKey().length : 0);
    }
  }
);
  return dimensions;
}

Fixed version (ground truth):
private List<DimensionDesc> getSortedDimentsionDescs(){
  List<DimensionDesc> dimensions=desc.getDimensions();
  Collections.sort(dimensions,new Comparator<DimensionDesc>(){
    @Override public int compare(    DimensionDesc o1,    DimensionDesc o2){
      JoinDesc j1=o2.getJoin();
      JoinDesc j2=o1.getJoin();
      return Integer.compare(j1 != null ? j1.getPrimaryKey().length : 0,j2 != null ? j2.getPrimaryKey().length : 0);
    }
  }
);
  return dimensions;
}
Program: 63333
Project: 63333
Buggy source:
private LinkedList<String> createRow(HashMap<String,String> factTableCol2LookupCol,HashSet<String> usedCols,HashSet<String> defaultColumns) throws Exception {
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  LinkedList<String> columnValues=new LinkedList<String>();
  for (  ColumnDesc cDesc : MetadataManager.getInstance(config).getTableDesc(factTableName).getColumns()) {
    int seed=r.nextInt();
    String colName=cDesc.getName();
    if (factTableCol2LookupCol.containsKey(colName)) {
      ArrayList<String> candidates=this.feasibleValues.get(factTableCol2LookupCol.get(colName));
      columnValues.add(candidates.get(Math.abs(seed) % candidates.size()));
    }
 else     if (usedCols.contains(colName)) {
      columnValues.add(createCell(cDesc));
    }
 else {
      columnValues.add(createDefaultsCell(cDesc.getTypeName()));
      defaultColumns.add(colName);
    }
  }
  return columnValues;
}

Fixed version (ground truth):
private LinkedList<String> createRow(HashMap<String,String> factTableCol2LookupCol,HashSet<String> usedCols,HashSet<String> defaultColumns) throws Exception {
  KylinConfig config=KylinConfig.getInstanceFromEnv();
  LinkedList<String> columnValues=new LinkedList<String>();
  for (  ColumnDesc cDesc : MetadataManager.getInstance(config).getTableDesc(factTableName).getColumns()) {
    String colName=cDesc.getName();
    if (factTableCol2LookupCol.containsKey(colName)) {
      ArrayList<String> candidates=this.feasibleValues.get(factTableCol2LookupCol.get(colName));
      columnValues.add(candidates.get(r.nextInt(candidates.size())));
    }
 else     if (usedCols.contains(colName)) {
      columnValues.add(createCell(cDesc));
    }
 else {
      columnValues.add(createDefaultsCell(cDesc.getTypeName()));
      defaultColumns.add(colName);
    }
  }
  return columnValues;
}
Program: 63335
Project: 63335
Buggy source:
/** 
 * Randomly create a fact table and put it to test_kylin_data table in hbase
 * @param cubeName name of the cube
 * @param rowCount expected row count generated
 * @param linkableRatio the percentage of fact table rows that can be linked with all lookup table by INNER join
 * @param randomSeed random seed
 */
public static void generate(String cubeName,String rowCount,String linkableRatio,String randomSeed,String joinType) throws Exception {
  if (cubeName == null)   cubeName="String_Node_Str";
  if (rowCount == null)   rowCount="String_Node_Str";
  if (linkableRatio == null)   linkableRatio="String_Node_Str";
  if (randomSeed == null)   ;
  FactTableGenerator generator=new FactTableGenerator();
  long seed;
  if (randomSeed != null) {
    seed=Long.parseLong(randomSeed);
  }
 else {
    Random r=new Random();
    seed=r.nextLong();
  }
  generator.init(cubeName,Integer.parseInt(rowCount),5,Double.parseDouble(linkableRatio),seed);
  generator.prepare();
  generator.execute(joinType);
}

Fixed version (ground truth):
/** 
 * Randomly create a fact table and put it to test_kylin_data table in hbase
 * @param cubeName      name of the cube
 * @param rowCount      expected row count generated
 * @param linkableRatio the percentage of fact table rows that can be linked with alllookup table by INNER join
 * @param randomSeed    random seed
 */
public static void generate(String cubeName,String rowCount,String linkableRatio,String randomSeed,String joinType) throws Exception {
  if (cubeName == null)   cubeName="String_Node_Str";
  if (rowCount == null)   rowCount="String_Node_Str";
  if (linkableRatio == null)   linkableRatio="String_Node_Str";
  FactTableGenerator generator=new FactTableGenerator();
  long seed;
  if (randomSeed != null) {
    seed=Long.parseLong(randomSeed);
  }
 else {
    Random r=new Random();
    seed=r.nextLong();
  }
  generator.init(cubeName,Integer.parseInt(rowCount),5,Double.parseDouble(linkableRatio),seed);
  generator.prepare();
  generator.execute(joinType);
}
Program: 63336
Project: 63336
Buggy source:
/** 
 * returns a code point from [0, nValues), preserving order of value, or -1 if not found
 * @param n -- the offset of current node
 * @param seq -- the code point under track
 * @param o -- write offset in returnValue
 * @param returnValue -- where return value is written to
 */
private int lookupValueFromSeqNo(int n,int seq,byte[] returnValue,int offset){
  int o=offset;
  while (true) {
    int p=n + firstByteOffset;
    int len=BytesUtil.readUnsigned(trieBytes,p - 1,1);
    System.arraycopy(trieBytes,p,returnValue,o,len);
    o+=len;
    boolean isEndOfValue=checkFlag(n,BIT_IS_END_OF_VALUE);
    if (isEndOfValue) {
      seq--;
      if (seq < 0)       return o - offset;
    }
    int c=headSize + (BytesUtil.readUnsigned(trieBytes,n,sizeChildOffset) & childOffsetMask);
    if (c == headSize)     return -1;
    int nValuesBeneath;
    while (true) {
      nValuesBeneath=BytesUtil.readUnsigned(trieBytes,c + sizeChildOffset,sizeNoValuesBeneath);
      if (seq - nValuesBeneath < 0) {
        n=c;
        break;
      }
 else {
        seq-=nValuesBeneath;
        if (checkFlag(c,BIT_IS_LAST_CHILD))         return -1;
        p=c + firstByteOffset;
        c=p + BytesUtil.readUnsigned(trieBytes,p - 1,1);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * returns a code point from [0, nValues), preserving order of value, or -1 if not found
 * @param n -- the offset of current node
 * @param seq -- the code point under track
 * @param returnValue -- where return value is written to
 */
private int lookupValueFromSeqNo(int n,int seq,byte[] returnValue,int offset){
  int o=offset;
  while (true) {
    int p=n + firstByteOffset;
    int len=BytesUtil.readUnsigned(trieBytes,p - 1,1);
    System.arraycopy(trieBytes,p,returnValue,o,len);
    o+=len;
    boolean isEndOfValue=checkFlag(n,BIT_IS_END_OF_VALUE);
    if (isEndOfValue) {
      seq--;
      if (seq < 0)       return o - offset;
    }
    int c=headSize + (BytesUtil.readUnsigned(trieBytes,n,sizeChildOffset) & childOffsetMask);
    if (c == headSize)     return -1;
    int nValuesBeneath;
    while (true) {
      nValuesBeneath=BytesUtil.readUnsigned(trieBytes,c + sizeChildOffset,sizeNoValuesBeneath);
      if (seq - nValuesBeneath < 0) {
        n=c;
        break;
      }
 else {
        seq-=nValuesBeneath;
        if (checkFlag(c,BIT_IS_LAST_CHILD))         return -1;
        p=c + firstByteOffset;
        c=p + BytesUtil.readUnsigned(trieBytes,p - 1,1);
      }
    }
  }
}
Program: 63337
Project: 63337
Buggy source:
public Cursor createCursor(AvaticaResultSet resultSet){
  KylinPrepare.PrepareResult result=((KylinResultSet)resultSet).getPrepareResult();
  return result.createCursor();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Cursor createCursor(AvaticaResultSet resultSet){
  KylinPrepare.PrepareResult result=((KylinResultSet)resultSet).getPrepareResult();
  return result.createCursor();
}
Program: 63338
Project: 63338
Buggy source:
/** 
 * @param statement
 * @param params
 */
private List<StateParam> genPrestateStates(AvaticaStatement statement){
  List<StateParam> params=new ArrayList<StateParam>();
  List<Object> values=((KylinJdbc41PreparedStatement)statement).getParameterValues();
  for (int i=0; i < values.size(); i++) {
    Object value=values.get(i);
    params.add(new StateParam(value.getClass().getCanonicalName(),(null == value) ? null : String.valueOf(value)));
  }
  return params;
}

Fixed version (ground truth):
/** 
 * @param statement
 * @param params
 */
private List<StateParam> genPrestateStates(AvaticaStatement statement){
  List<StateParam> params=new ArrayList<StateParam>();
  List<Object> values=((KylinJdbc41PreparedStatement)statement).getParameterValues();
  for (int i=0; i < values.size(); i++) {
    Object value=values.get(i);
    params.add(new StateParam(value.getClass().getCanonicalName(),String.valueOf(value)));
  }
  return params;
}