nus-yam/ex-repair huggingface dataset:
Program: 63213
Project: 63213
Buggy source:
private void reloadAllIIDesc() throws IOException {
  ResourceStore store=getStore();
  logger.info("String_Node_Str" + store.getReadableResourcePath(ResourceStore.II_DESC_RESOURCE_ROOT));
  iiDescMap.clear();
  List<String> paths=store.collectResourceRecursively(ResourceStore.II_DESC_RESOURCE_ROOT,MetadataConstances.FILE_SURFIX);
  for (  String path : paths) {
    IIDesc desc;
    try {
      desc=loadIIDesc(path);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + path,e);
      continue;
    }
    if (path.equals(desc.getResourcePath()) == false) {
      logger.error("String_Node_Str" + path + "String_Node_Str"+ desc+ "String_Node_Str"+ desc.getResourcePath());
      continue;
    }
    if (iiDescMap.containsKey(desc.getName())) {
      logger.error("String_Node_Str" + desc.getName() + "String_Node_Str"+ path);
      continue;
    }
    iiDescMap.putLocal(desc.getName(),desc);
  }
  logger.debug("String_Node_Str" + iiDescMap.size() + "String_Node_Str");
}

Fixed version (ground truth):
private void reloadAllIIDesc() throws IOException {
  ResourceStore store=getStore();
  logger.info("String_Node_Str" + store.getReadableResourcePath(ResourceStore.II_DESC_RESOURCE_ROOT));
  iiDescMap.clear();
  List<String> paths=store.collectResourceRecursively(ResourceStore.II_DESC_RESOURCE_ROOT,MetadataConstances.FILE_SURFIX);
  for (  String path : paths) {
    logger.info("String_Node_Str" + path);
    IIDesc desc;
    try {
      desc=loadIIDesc(path);
    }
 catch (    Exception e) {
      logger.error("String_Node_Str" + path,e);
      continue;
    }
    if (!path.equals(desc.getResourcePath())) {
      logger.error("String_Node_Str" + path + "String_Node_Str"+ desc+ "String_Node_Str"+ desc.getResourcePath());
      continue;
    }
    if (iiDescMap.containsKey(desc.getName())) {
      logger.error("String_Node_Str" + desc.getName() + "String_Node_Str"+ path);
      continue;
    }
    iiDescMap.putLocal(desc.getName(),desc);
  }
  logger.debug("String_Node_Str" + iiDescMap.size() + "String_Node_Str");
}
Program: 63214
Project: 63214
Buggy source:
public TableRecordInfo(IISegment iiSegment){
  seg=iiSegment;
  desc=seg.getIIInstance().getDescriptor();
  allColumns=desc.listAllColumns();
  nColumns=allColumns.size();
  dictionaries=new Dictionary<?>[nColumns];
  measureSerializers=new FixedLenMeasureCodec<?>[nColumns];
  DictionaryManager dictMgr=DictionaryManager.getInstance(desc.getConfig());
  for (  TblColRef tblColRef : desc.listAllColumns()) {
    ColumnDesc col=tblColRef.getColumn();
    int i=col.getZeroBasedIndex();
    if (desc.isMetricsCol(i)) {
      measureSerializers[i]=FixedLenMeasureCodec.get(col.getType());
    }
 else {
      String dictPath=seg.getDictResPath(tblColRef);
      try {
        dictionaries[i]=dictMgr.getDictionary(dictPath);
      }
 catch (      IOException e) {
        throw new RuntimeException("String_Node_Str" + dictPath + "String_Node_Str",e);
      }
    }
  }
  digest=createDigest();
}

Fixed version (ground truth):
public TableRecordInfo(IISegment iiSegment){
  seg=iiSegment;
  desc=seg.getIIInstance().getDescriptor();
  allColumns=desc.listAllColumns();
  nColumns=allColumns.size();
  dictionaries=new Dictionary<?>[nColumns];
  measureSerializers=new FixedLenMeasureCodec<?>[nColumns];
  DictionaryManager dictMgr=DictionaryManager.getInstance(desc.getConfig());
  int index=0;
  for (  TblColRef tblColRef : desc.listAllColumns()) {
    ColumnDesc col=tblColRef.getColumn();
    if (desc.isMetricsCol(index)) {
      measureSerializers[index]=FixedLenMeasureCodec.get(col.getType());
    }
 else {
      String dictPath=seg.getDictResPath(tblColRef);
      try {
        dictionaries[index]=dictMgr.getDictionary(dictPath);
      }
 catch (      IOException e) {
        throw new RuntimeException("String_Node_Str" + dictPath + "String_Node_Str",e);
      }
    }
    index++;
  }
  digest=createDigest();
}
Program: 63215
Project: 63215
Buggy source:
public IIDesc getIIDesc(String name){
  return iiDescMap.get(name);
}

Fixed version (ground truth):
public IIDesc getIIDesc(String name){
  return iiDescMap.get(name.toUpperCase());
}
Program: 63216
Project: 63216
Buggy source:
public static String generateCreateTableStatement(JoinedFlatTableDesc intermediateTableDesc,String storageDfsDir,String jobUUID){
  StringBuilder ddl=new StringBuilder();
  ddl.append("String_Node_Str" + intermediateTableDesc.getTableName(jobUUID) + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  for (int i=0; i < intermediateTableDesc.getColumnList().size(); i++) {
    IntermediateColumnDesc col=intermediateTableDesc.getColumnList().get(i);
    if (i > 0) {
      ddl.append("String_Node_Str");
    }
    ddl.append(col.getColumnName() + "String_Node_Str" + SqlHiveDataTypeMapping.getHiveDataType(col.getDataType())+ "String_Node_Str");
  }
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + storageDfsDir + "String_Node_Str"+ intermediateTableDesc.getTableName(jobUUID)+ "String_Node_Str"+ "String_Node_Str");
  return ddl.toString();
}

Fixed version (ground truth):
public static String generateCreateTableStatement(JoinedFlatTableDesc intermediateTableDesc,String storageDfsDir,String jobUUID){
  StringBuilder ddl=new StringBuilder();
  ddl.append("String_Node_Str" + intermediateTableDesc.getTableName(jobUUID) + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  for (int i=0; i < intermediateTableDesc.getColumnList().size(); i++) {
    IntermediateColumnDesc col=intermediateTableDesc.getColumnList().get(i);
    if (i > 0) {
      ddl.append("String_Node_Str");
    }
    String fullColumnName=(col.getTableName() + "String_Node_Str" + col.getColumnName()).replace("String_Node_Str","String_Node_Str");
    ddl.append(fullColumnName + "String_Node_Str" + SqlHiveDataTypeMapping.getHiveDataType(col.getDataType())+ "String_Node_Str");
  }
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + "String_Node_Str");
  ddl.append("String_Node_Str" + storageDfsDir + "String_Node_Str"+ intermediateTableDesc.getTableName(jobUUID)+ "String_Node_Str"+ "String_Node_Str");
  return ddl.toString();
}
Program: 63217
Project: 63217
Buggy source:
@Test public void testBasics() throws Exception {
  String content=FactTableGenerator.generate("String_Node_Str","String_Node_Str","String_Node_Str",null,"String_Node_Str");
  System.out.println(content);
  assertTrue(content.contains("String_Node_Str"));
  assertTrue(content.contains("String_Node_Str"));
  DeployUtil.overrideFactTableData(content,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBasics() throws Exception {
  String content=FactTableGenerator.generate("String_Node_Str","String_Node_Str","String_Node_Str",null,"String_Node_Str");
  System.out.println(content);
  assertTrue(content.contains("String_Node_Str"));
  assertTrue(content.contains("String_Node_Str"));
  DeployUtil.overrideFactTableData(content,"String_Node_Str");
}
Program: 63218
Project: 63218
Buggy source:
private boolean hasOverlap(long startDate,long endDate,long anotherStartDate,long anotherEndDate){
  if (startDate >= endDate) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (anotherStartDate >= anotherEndDate) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (startDate <= anotherStartDate && anotherEndDate < endDate) {
    return true;
  }
  if (startDate < anotherEndDate && anotherEndDate <= endDate) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean hasOverlap(long startDate,long endDate,long anotherStartDate,long anotherEndDate){
  if (startDate >= endDate) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (anotherStartDate >= anotherEndDate) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (startDate <= anotherStartDate && anotherStartDate < endDate) {
    return true;
  }
  if (startDate < anotherEndDate && anotherEndDate <= endDate) {
    return true;
  }
  return false;
}
Program: 63220
Project: 63220
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.getIdentity().toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),table);
    loadedTables.add(table.getIdentity());
  }
  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.getIdentity().toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),table);
    loadedTables.add(table.getIdentity());
  }
  for (  Map<String,String> tableAttrs : tableAttrsList) {
    File file=new File(tableExdDir,(database + "String_Node_Str" + tableAttrs.get("String_Node_Str")).toUpperCase() + "String_Node_Str" + OUTPUT_SURFIX);
    JsonUtil.writeValueIndent(new FileOutputStream(file),tableAttrs);
  }
  return loadedTables;
}
Program: 63221
Project: 63221
Buggy source:
public void addOrUpdateJobOutput(String uuid,JobOutputPO output) throws PersistentException {
  if (output == null) {
    return;
  }
  try {
    writeJobOutputResource(pathOfJobOutput(uuid),output);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new PersistentException(e);
  }
}

Fixed version (ground truth):
public void addOrUpdateJobOutput(String uuid,JobOutputPO output) throws PersistentException {
  if (output == null) {
    return;
  }
  try {
    deleteJobOutput(uuid);
    writeJobOutputResource(pathOfJobOutput(uuid),output);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new PersistentException(e);
  }
}
Program: 63222
Project: 63222
Buggy source:
public JobOutputPO getJobOutput(String uuid) throws PersistentException {
  try {
    JobOutputPO jobOutputPO=readJobOutputResource(pathOfJobOutput(uuid));
    return jobOutputPO;
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new PersistentException(e);
  }
}

Fixed version (ground truth):
public JobOutputPO getJobOutput(String uuid) throws PersistentException {
  try {
    JobOutputPO result=readJobOutputResource(pathOfJobOutput(uuid));
    if (result == null) {
      result=new JobOutputPO();
      result.setStatus(ExecutableStatus.READY.toString());
      result.setUuid(uuid);
      return result;
    }
    return result;
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new PersistentException(e);
  }
}
Program: 63223
Project: 63223
Buggy source:
@Override public boolean isRunnable(){
  for (  Executable subTask : getExecutables()) {
    if (subTask.isRunnable()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isRunnable(){
  return getStatus() == ExecutableStatus.READY;
}
Program: 63224
Project: 63224
Buggy source:
@Override public synchronized void init(JobEngineConfig jobEngineConfig) throws SchedulerException {
  if (!initialized) {
    initialized=true;
  }
 else {
    return;
  }
  this.jobEngineConfig=jobEngineConfig;
  jobService=DefaultJobService.getInstance(jobEngineConfig.getConfig());
  fetcherPool=Executors.newScheduledThreadPool(1);
  int corePoolSize=jobEngineConfig.getMaxConcurrentJobLimit();
  jobPool=new ThreadPoolExecutor(corePoolSize,corePoolSize,Long.MAX_VALUE,TimeUnit.DAYS,new SynchronousQueue<Runnable>());
  context=new DefaultContext(Maps.<String,Executable>newConcurrentMap());
  RetryPolicy retryPolicy=new ExponentialBackoffRetry(1000,3);
  this.zkClient=CuratorFrameworkFactory.newClient(jobEngineConfig.getZookeeperString(),retryPolicy);
  this.zkClient.start();
  Runtime.getRuntime().addShutdownHook(new Thread(){
    public void run(){
      logger.debug("String_Node_Str");
      try {
        shutdown();
      }
 catch (      SchedulerException e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
);
  fetcherPool.scheduleAtFixedRate(new FetcherRunner(),10,JobConstants.DEFAULT_SCHEDULER_INTERVAL_SECONDS,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Override public synchronized void init(JobEngineConfig jobEngineConfig) throws SchedulerException {
  if (!initialized) {
    initialized=true;
  }
 else {
    return;
  }
  this.jobEngineConfig=jobEngineConfig;
  jobService=DefaultJobService.getInstance(jobEngineConfig.getConfig());
  fetcherPool=Executors.newScheduledThreadPool(1);
  int corePoolSize=jobEngineConfig.getMaxConcurrentJobLimit();
  jobPool=new ThreadPoolExecutor(corePoolSize,corePoolSize,Long.MAX_VALUE,TimeUnit.DAYS,new SynchronousQueue<Runnable>());
  context=new DefaultContext(Maps.<String,Executable>newConcurrentMap());
  RetryPolicy retryPolicy=new ExponentialBackoffRetry(1000,3);
  this.zkClient=CuratorFrameworkFactory.newClient(jobEngineConfig.getZookeeperString(),retryPolicy);
  this.zkClient.start();
  for (  AbstractExecutable executable : jobService.getAllExecutables()) {
    if (executable.getStatus() == ExecutableStatus.RUNNING) {
      jobService.updateJobStatus(executable.getId(),ExecutableStatus.READY,null);
    }
  }
  Runtime.getRuntime().addShutdownHook(new Thread(){
    public void run(){
      logger.debug("String_Node_Str");
      try {
        shutdown();
      }
 catch (      SchedulerException e) {
        logger.error("String_Node_Str",e);
      }
    }
  }
);
  fetcherPool.scheduleAtFixedRate(new FetcherRunner(),10,JobConstants.DEFAULT_SCHEDULER_INTERVAL_SECONDS,TimeUnit.SECONDS);
}
Program: 63225
Project: 63225
Buggy source:
private boolean acquireJobLock(String jobId,long timeoutSeconds) throws LockException {
  return !context.getRunningJobs().containsKey(jobId);
}

Fixed version (ground truth):
private boolean acquireJobLock(Executable executable,long timeoutSeconds) throws LockException {
  Map<String,Executable> runningJobs=context.getRunningJobs();
  if (runningJobs.size() >= jobEngineConfig.getMaxConcurrentJobLimit()) {
    return false;
  }
  if (runningJobs.containsKey(executable.getId())) {
    return false;
  }
  if (!executable.isRunnable()) {
    return false;
  }
  return true;
}
Program: 63226
Project: 63226
Buggy source:
private String schedulerId() throws UnknownHostException {
  return ZOOKEEPER_LOCK_PATH + "String_Node_Str" + InetAddress.getLocalHost().getCanonicalHostName();
}

Fixed version (ground truth):
private String schedulerId(){
  try {
    String canonicalHostName=InetAddress.getLocalHost().getCanonicalHostName();
    return ZOOKEEPER_LOCK_PATH + "String_Node_Str" + canonicalHostName;
  }
 catch (  UnknownHostException e) {
    throw new RuntimeException(e);
  }
}
Program: 63227
Project: 63227
Buggy source:
@Override public void stateChanged(CuratorFramework client,ConnectionState newState){
}

Fixed version (ground truth):
@Override public void stateChanged(CuratorFramework client,ConnectionState newState){
  if ((newState == ConnectionState.SUSPENDED) || (newState == ConnectionState.LOST)) {
    releaseLock();
  }
}
Program: 63228
Project: 63228
Buggy source:
public ExecutableStatus getJobStatus(String uuid){
  try {
    JobOutputPO jobOutput=jobDao.getJobOutput(uuid);
    if (jobOutput == null) {
      return ExecutableStatus.READY;
    }
 else {
      return ExecutableStatus.valueOf(jobOutput.getStatus());
    }
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public ExecutableStatus getJobStatus(String uuid){
  try {
    return ExecutableStatus.valueOf(jobDao.getJobOutput(uuid).getStatus());
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new RuntimeException(e);
  }
}
Program: 63229
Project: 63229
Buggy source:
private void updateJobOutput(String uuid,JobOutputPO output){
  try {
    if (jobDao.getJobOutput(uuid) != null) {
      jobDao.deleteJobOutput(uuid);
    }
    jobDao.addOrUpdateJobOutput(uuid,output);
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void updateJobOutput(String uuid,JobOutputPO output){
  try {
    jobDao.addOrUpdateJobOutput(uuid,output);
  }
 catch (  PersistentException e) {
    logger.error("String_Node_Str" + uuid,e);
    throw new RuntimeException(e);
  }
}
Program: 63230
Project: 63230
Buggy source:
private void waitForJob(String jobId){
  while (true) {
    AbstractExecutable job=jobService.getJob(jobId);
    System.out.println("String_Node_Str" + jobId + "String_Node_Str"+ job.getStatus());
    if (job.getStatus() == ExecutableStatus.SUCCEED || job.getStatus() == ExecutableStatus.ERROR) {
      break;
    }
 else {
      try {
        Thread.sleep(30000);
      }
 catch (      InterruptedException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void waitForJob(String jobId){
  while (true) {
    AbstractExecutable job=jobService.getJob(jobId);
    System.out.println("String_Node_Str" + jobId + "String_Node_Str"+ job.getStatus());
    if (job.getStatus() == ExecutableStatus.SUCCEED || job.getStatus() == ExecutableStatus.ERROR) {
      break;
    }
 else {
      try {
        Thread.sleep(5000);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
  }
}
Program: 63231
Project: 63231
Buggy source:
@SuppressWarnings("String_Node_Str") private void testSimpleLeftJoinCube() throws Exception {
  DeployUtil.prepareTestData("String_Node_Str","String_Node_Str");
  SimpleDateFormat f=new SimpleDateFormat("String_Node_Str");
  f.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  long dateStart;
  long dateEnd;
  ArrayList<String> jobs=new ArrayList<String>();
  CubeManager cubeMgr=CubeManager.getInstance(KylinConfig.getInstanceFromEnv());
  dateStart=cubeMgr.getCube("String_Node_Str").getDescriptor().getCubePartitionDesc().getPartitionDateStart();
  dateEnd=f.parse("String_Node_Str").getTime();
  jobs.addAll(this.submitJob("String_Node_Str",dateStart,dateEnd,CubeBuildTypeEnum.BUILD));
  dateStart=cubeMgr.getCube("String_Node_Str").getDescriptor().getCubePartitionDesc().getPartitionDateStart();
  dateEnd=f.parse("String_Node_Str").getTime();
  jobs.addAll(this.submitJob("String_Node_Str",dateStart,dateEnd,CubeBuildTypeEnum.BUILD));
  waitCubeBuilt(jobs);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void testSimpleLeftJoinCube() throws Exception {
  DeployUtil.prepareTestData("String_Node_Str","String_Node_Str");
  SimpleDateFormat f=new SimpleDateFormat("String_Node_Str");
  f.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  long dateStart;
  long dateEnd;
  ArrayList<String> jobs=new ArrayList<String>();
  CubeManager cubeMgr=CubeManager.getInstance(KylinConfig.getInstanceFromEnv());
  dateStart=cubeMgr.getCube("String_Node_Str").getDescriptor().getCubePartitionDesc().getPartitionDateStart();
  dateEnd=f.parse("String_Node_Str").getTime();
  jobs.addAll(this.submitJob("String_Node_Str",dateStart,dateEnd,RealizationBuildTypeEnum.BUILD));
  dateStart=cubeMgr.getCube("String_Node_Str").getDescriptor().getCubePartitionDesc().getPartitionDateStart();
  dateEnd=f.parse("String_Node_Str").getTime();
  jobs.addAll(this.submitJob("String_Node_Str",dateStart,dateEnd,RealizationBuildTypeEnum.BUILD));
  waitCubeBuilt(jobs);
}
Program: 63232
Project: 63232
Buggy source:
@BeforeClass public static void setupBeforeClass() throws Exception {
  staticCreateTestMetadata();
  TEST_UTIL=new HBaseTestingUtility();
  CONF=TEST_UTIL.getConfiguration();
  CONF.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,IIEndpoint.class.getName());
  TEST_UTIL.startMiniCluster();
  mockIIHtable();
  hconn=HConnectionManager.createConnection(CONF);
}

Fixed version (ground truth):
@BeforeClass public static void setupBeforeClass() throws Exception {
  staticCreateTestMetadata(SANDBOX_TEST_DATA);
  TEST_UTIL=new HBaseTestingUtility();
  CONF=TEST_UTIL.getConfiguration();
  CONF.setStrings(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,IIEndpoint.class.getName());
  TEST_UTIL.startMiniCluster();
  mockIIHtable();
  hconn=HConnectionManager.createConnection(CONF);
}
Program: 63233
Project: 63233
Buggy source:
@Before public void setup() throws Exception {
  super.setUp();
  jobSchedulerController=new JobController();
  jobSchedulerController.setJobService(jobService);
  cubeController=new CubeController();
  cubeController.setJobService(jobService);
  cubeController.setCubeService(cubeService);
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  super.setUp();
  jobSchedulerController=new JobController();
  jobSchedulerController.setJobService(jobService);
  cubeController=new CubeController();
  cubeController.setJobService(jobService);
  cubeController.setCubeService(cubeService);
  KylinConfig testConfig=getTestConfig();
  cubeManager=CubeManager.getInstance(testConfig);
  cubeDescManager=CubeDescManager.getInstance(testConfig);
  jobDAO=JobDAO.getInstance(testConfig);
}
Program: 63234
Project: 63234
Buggy source:
@Test public void testBasics() throws IOException {
  KylinConfig testConfig=getTestConfig();
  CubeManager cubeManager=CubeManager.getInstance(testConfig);
  if (cubeManager.getCube(CUBE_NAME) != null) {
    cubeManager.dropCube(CUBE_NAME,false);
  }
  CubeDescManager cubeDescManager=CubeDescManager.getInstance(testConfig);
  CubeDesc cubeDesc=cubeDescManager.getCubeDesc("String_Node_Str");
  CubeInstance cube=cubeManager.createCube(CUBE_NAME,"String_Node_Str",cubeDesc,"String_Node_Str");
  assertNotNull(cube);
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(0L);
  jobBuildRequest.setEndTime(new Date().getTime());
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
  JobDAO.getInstance(testConfig).deleteJob(job);
}

Fixed version (ground truth):
@Test public void testBasics() throws IOException {
  CubeDesc cubeDesc=cubeDescManager.getCubeDesc("String_Node_Str");
  CubeInstance cube=cubeManager.createCube(CUBE_NAME,"String_Node_Str",cubeDesc,"String_Node_Str");
  assertNotNull(cube);
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(0L);
  jobBuildRequest.setEndTime(new Date().getTime());
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
  jobDAO.deleteJob(job);
  if (cubeManager.getCube(CUBE_NAME) != null) {
    cubeManager.dropCube(CUBE_NAME,false);
  }
}
Program: 63235
Project: 63235
Buggy source:
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  ProjectManager.removeInstance(this.getTestConfig());
  cubeManager=CubeManager.getInstance(this.getTestConfig());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  CubeRealizationManager.removeInstance(this.getTestConfig());
  cubeManager=CubeManager.getInstance(this.getTestConfig());
}
Program: 63236
Project: 63236
Buggy source:
@Test public void testCreateAndDrop() throws Exception {
  ResourceStore store=getStore();
  store.deleteResource("String_Node_Str");
  CubeDescManager cubeDescMgr=getCubeDescManager();
  CubeDesc desc=cubeDescMgr.getCubeDesc("String_Node_Str");
  CubeInstance createdCube=CubeManager.getInstance(this.getTestConfig()).createCube("String_Node_Str",ProjectInstance.DEFAULT_PROJECT_NAME,desc,null);
  assertTrue(createdCube == CubeManager.getInstance(this.getTestConfig()).getCube("String_Node_Str"));
  assertTrue(ProjectManager.getInstance(getTestConfig()).listAllCubes(ProjectInstance.DEFAULT_PROJECT_NAME).contains(createdCube));
  CubeInstance droppedCube=CubeManager.getInstance(this.getTestConfig()).dropCube("String_Node_Str",true);
  assertTrue(createdCube == droppedCube);
  assertTrue(!ProjectManager.getInstance(getTestConfig()).listAllCubes(ProjectInstance.DEFAULT_PROJECT_NAME).contains(droppedCube));
  assertNull(CubeManager.getInstance(this.getTestConfig()).getCube("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testCreateAndDrop() throws Exception {
  ResourceStore store=getStore();
  store.deleteResource("String_Node_Str");
  CubeDescManager cubeDescMgr=getCubeDescManager();
  CubeDesc desc=cubeDescMgr.getCubeDesc("String_Node_Str");
  CubeInstance createdCube=CubeManager.getInstance(this.getTestConfig()).createCube("String_Node_Str",ProjectInstance.DEFAULT_PROJECT_NAME,desc,null);
  assertTrue(createdCube == CubeManager.getInstance(this.getTestConfig()).getCube("String_Node_Str"));
  assertTrue(CubeRealizationManager.getInstance(getTestConfig()).listAllCubes(ProjectInstance.DEFAULT_PROJECT_NAME).contains(createdCube));
  CubeInstance droppedCube=CubeManager.getInstance(this.getTestConfig()).dropCube("String_Node_Str",true);
  assertTrue(createdCube == droppedCube);
  assertTrue(!CubeRealizationManager.getInstance(getTestConfig()).listAllCubes(ProjectInstance.DEFAULT_PROJECT_NAME).contains(droppedCube));
  assertNull(CubeManager.getInstance(this.getTestConfig()).getCube("String_Node_Str"));
}
Program: 63237
Project: 63237
Buggy source:
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  ProjectManager.removeInstance(this.getTestConfig());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  CubeRealizationManager.removeInstance(this.getTestConfig());
}
Program: 63238
Project: 63238
Buggy source:
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  ProjectManager.removeInstance(this.getTestConfig());
  cubeMgr=CubeManager.getInstance(this.getTestConfig());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  CubeRealizationManager.removeInstance(this.getTestConfig());
  cubeMgr=CubeManager.getInstance(this.getTestConfig());
}
Program: 63239
Project: 63239
Buggy source:
@Before public void before() throws Exception {
  SSHClient hadoopCli=new SSHClient(getHadoopCliHostname(),getHadoopCliUsername(),getHadoopCliPassword());
  removeHdfsDir(hadoopCli,mrOutputDir1);
  removeHdfsDir(hadoopCli,mrOutputDir2);
  MetadataManager.removeInstance(KylinConfig.getInstanceFromEnv());
  CubeManager.removeInstance(KylinConfig.getInstanceFromEnv());
  ProjectManager.removeInstance(KylinConfig.getInstanceFromEnv());
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  SSHClient hadoopCli=new SSHClient(getHadoopCliHostname(),getHadoopCliUsername(),getHadoopCliPassword());
  removeHdfsDir(hadoopCli,mrOutputDir1);
  removeHdfsDir(hadoopCli,mrOutputDir2);
  MetadataManager.removeInstance(KylinConfig.getInstanceFromEnv());
  CubeManager.removeInstance(KylinConfig.getInstanceFromEnv());
  CubeRealizationManager.removeInstance(KylinConfig.getInstanceFromEnv());
}
Program: 63240
Project: 63240
Buggy source:
@Before public void before() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  ProjectManager.removeInstance(this.getTestConfig());
  DictionaryManager.removeInstance(this.getTestConfig());
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  this.createTestMetadata();
  MetadataManager.removeInstance(this.getTestConfig());
  CubeManager.removeInstance(this.getTestConfig());
  CubeRealizationManager.removeInstance(this.getTestConfig());
  DictionaryManager.removeInstance(this.getTestConfig());
}
Program: 63242
Project: 63242
Buggy source:
/** 
 * Get available table list of the input database
 * @return Table metadata array
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody @Metered(name="String_Node_Str") public List<TableDesc> getHiveTables(@RequestParam(value="String_Node_Str",required=false) boolean withExt,@RequestParam(value="String_Node_Str",required=false) String project){
  long start=System.currentTimeMillis();
  List<TableDesc> tables=null;
  try {
    tables=cubeMgmtService.getProjectManager().listDefinedTablesInProject(project);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
  if (withExt) {
    tables=cloneTableDesc(tables);
  }
  long end=System.currentTimeMillis();
  logger.info("String_Node_Str" + (end - start) + "String_Node_Str");
  return tables;
}

Fixed version (ground truth):
/** 
 * Get available table list of the input database
 * @return Table metadata array
 * @throws IOException
 */
@RequestMapping(value="String_Node_Str",method={RequestMethod.GET}) @ResponseBody @Metered(name="String_Node_Str") public List<TableDesc> getHiveTables(@RequestParam(value="String_Node_Str",required=false) boolean withExt,@RequestParam(value="String_Node_Str",required=false) String project){
  long start=System.currentTimeMillis();
  List<TableDesc> tables=null;
  try {
    tables=cubeMgmtService.getCubeRealizationManager().listDefinedTablesInProject(project);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    throw new InternalErrorException(e.getLocalizedMessage());
  }
  if (withExt) {
    tables=cloneTableDesc(tables);
  }
  long end=System.currentTimeMillis();
  logger.info("String_Node_Str" + (end - start) + "String_Node_Str");
  return tables;
}
Program: 63243
Project: 63243
Buggy source:
public CubeRealizationManager getProjectManager(){
  return CubeRealizationManager.getInstance(getConfig());
}

Fixed version (ground truth):
public ProjectManager getProjectManager(){
  return ProjectManager.getInstance(getConfig());
}
Program: 63244
Project: 63244
Buggy source:
@Test public void testBasics() throws IOException {
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobInstance job=null;
  try {
    JobBuildRequest jobBuildRequest=new JobBuildRequest();
    jobBuildRequest.setBuildType("String_Node_Str");
    jobBuildRequest.setStartTime(1386806400000L);
    jobBuildRequest.setEndTime(new Date().getTime());
    job=cubeController.rebuild("String_Node_Str",jobBuildRequest);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
}

Fixed version (ground truth):
@Test public void testBasics() throws IOException {
  CubeManager cubeManager=CubeManager.getInstance(getTestConfig());
  if (cubeManager.getCube(CUBE_NAME) != null) {
    cubeManager.dropCube(CUBE_NAME,false);
  }
  CubeDescManager cubeDescManager=CubeDescManager.getInstance(getTestConfig());
  CubeDesc cubeDesc=cubeDescManager.getCubeDesc("String_Node_Str");
  CubeInstance cube=cubeManager.createCube(CUBE_NAME,"String_Node_Str",cubeDesc,"String_Node_Str");
  assertNotNull(cube);
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(1386806400000L);
  jobBuildRequest.setEndTime(new Date().getTime());
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
  try {
    jobSchedulerController.cancel(job.getId());
  }
 catch (  InternalErrorException e) {
  }
}
Program: 63245
Project: 63245
Buggy source:
@Test(expected=RuntimeException.class) public void testResume() throws IOException {
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(20130331080000L);
  jobBuildRequest.setEndTime(20131212080000L);
  JobInstance job=cubeController.rebuild("String_Node_Str",jobBuildRequest);
  jobSchedulerController.resume(job.getId());
}

Fixed version (ground truth):
@Test(expected=RuntimeException.class) public void testResume() throws IOException {
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(20130331080000L);
  jobBuildRequest.setEndTime(20131212080000L);
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  jobSchedulerController.resume(job.getId());
}
Program: 63246
Project: 63246
Buggy source:
@Before public void setup(){
  super.setUp();
  projectController=new ProjectController();
  projectController.setProjectService(projectService);
}

Fixed version (ground truth):
@Before public void setup(){
  super.setUp();
  projectController=new ProjectController();
  projectController.setProjectService(projectService);
  try {
    projectController.deleteProject("String_Node_Str");
  }
 catch (  InternalErrorException e) {
  }
  try {
    projectController.deleteProject("String_Node_Str");
  }
 catch (  InternalErrorException e) {
  }
}
Program: 63247
Project: 63247
Buggy source:
@Test public void testBasics() throws IOException {
  CubeManager cubeManager=CubeManager.getInstance(getTestConfig());
  if (cubeManager.getCube(CUBE_NAME) != null) {
    cubeManager.dropCube(CUBE_NAME,false);
  }
  CubeDescManager cubeDescManager=CubeDescManager.getInstance(getTestConfig());
  CubeDesc cubeDesc=cubeDescManager.getCubeDesc("String_Node_Str");
  CubeInstance cube=cubeManager.createCube(CUBE_NAME,"String_Node_Str",cubeDesc,"String_Node_Str");
  assertNotNull(cube);
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(1386806400000L);
  jobBuildRequest.setEndTime(new Date().getTime());
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
  try {
    jobSchedulerController.cancel(job.getId());
  }
 catch (  InternalErrorException e) {
  }
}

Fixed version (ground truth):
@Test public void testBasics() throws IOException {
  KylinConfig testConfig=getTestConfig();
  CubeManager cubeManager=CubeManager.getInstance(testConfig);
  if (cubeManager.getCube(CUBE_NAME) != null) {
    cubeManager.dropCube(CUBE_NAME,false);
  }
  CubeDescManager cubeDescManager=CubeDescManager.getInstance(testConfig);
  CubeDesc cubeDesc=cubeDescManager.getCubeDesc("String_Node_Str");
  CubeInstance cube=cubeManager.createCube(CUBE_NAME,"String_Node_Str",cubeDesc,"String_Node_Str");
  assertNotNull(cube);
  JobListRequest jobRequest=new JobListRequest();
  Assert.assertNotNull(jobSchedulerController.list(jobRequest));
  JobBuildRequest jobBuildRequest=new JobBuildRequest();
  jobBuildRequest.setBuildType("String_Node_Str");
  jobBuildRequest.setStartTime(0L);
  jobBuildRequest.setEndTime(new Date().getTime());
  JobInstance job=cubeController.rebuild(CUBE_NAME,jobBuildRequest);
  Assert.assertNotNull(jobSchedulerController.get(job.getId()));
  Map<String,String> output=jobSchedulerController.getStepOutput(job.getId(),0);
  Assert.assertNotNull(output);
  JobDAO.getInstance(testConfig).deleteJob(job);
}
Program: 63248
Project: 63248
Buggy source:
/** 
 * @param uuid
 * @param jobInstance
 * @throws IOException
 * @throws JobException
 */
private void killRunningJob(JobInstance jobInstance) throws IOException, JobException {
  JobStep runningStep=jobInstance.getRunningStep();
  if (runningStep == null) {
    throw new IllegalStateException("String_Node_Str" + jobInstance.getUuid());
  }
  runningStep.setStatus(JobStepStatusEnum.DISCARDED);
  runningStep.setExecEndTime(System.currentTimeMillis());
  jobDAO.updateJobInstance(jobInstance);
  this.jobEngine.interruptJob(jobInstance,runningStep);
}

Fixed version (ground truth):
/** 
 * @param jobInstance
 * @throws IOException
 * @throws JobException
 */
private void killRunningJob(JobInstance jobInstance) throws IOException, JobException {
  JobStep runningStep=jobInstance.getRunningStep();
  if (runningStep == null) {
    throw new IllegalStateException("String_Node_Str" + jobInstance.getUuid());
  }
  runningStep.setStatus(JobStepStatusEnum.DISCARDED);
  runningStep.setExecEndTime(System.currentTimeMillis());
  jobDAO.updateJobInstance(jobInstance);
  this.jobEngine.interruptJob(jobInstance,runningStep);
}
Program: 63249
Project: 63249
Buggy source:
public CubeInstance createCube(String cubeName,String projectName,CubeDesc desc,String owner) throws IOException {
  logger.info("String_Node_Str" + projectName + "String_Node_Str"+ cubeName+ "String_Node_Str"+ desc.getName()+ "String_Node_Str");
  CubeInstance cube=CubeInstance.create(cubeName,projectName,desc);
  cube.setOwner(owner);
  saveResource(cube);
  ProjectManager.getInstance(config).updateCubeToProject(cubeName,projectName,owner);
  return cube;
}

Fixed version (ground truth):
public CubeInstance createCube(String cubeName,String projectName,CubeDesc desc,String owner) throws IOException {
  logger.info("String_Node_Str" + projectName + "String_Node_Str"+ cubeName+ "String_Node_Str"+ desc.getName()+ "String_Node_Str");
  CubeInstance cube=CubeInstance.create(cubeName,projectName,desc);
  cube.setOwner(owner);
  saveResource(cube);
  ProjectManager.getInstance(config).updateCubeToProject(cubeName,projectName,owner);
  CubeRealizationManager.getInstance(config).loadProject(ProjectManager.getInstance(config).getProject(projectName));
  return cube;
}
Program: 63250
Project: 63250
Buggy source:
public CubeInstance dropCube(String cubeName,boolean deleteDesc) throws IOException {
  logger.info("String_Node_Str" + cubeName + "String_Node_Str");
  List<ProjectInstance> projects=ProjectManager.getInstance(config).getProjects(cubeName);
  ResourceStore store=getStore();
  CubeInstance cube=getCube(cubeName);
  if (deleteDesc && cube.getDescriptor() != null)   store.deleteResource(cube.getDescriptor().getResourcePath());
  store.deleteResource(cube.getResourcePath());
  ProjectManager.getInstance(config).removeCubeFromProjects(cubeName);
  this.afterCubeDroped(cube,projects);
  return cube;
}

Fixed version (ground truth):
public CubeInstance dropCube(String cubeName,boolean deleteDesc) throws IOException {
  logger.info("String_Node_Str" + cubeName + "String_Node_Str");
  List<ProjectInstance> projects=ProjectManager.getInstance(config).getProjects(cubeName);
  ResourceStore store=getStore();
  CubeInstance cube=getCube(cubeName);
  if (deleteDesc && cube.getDescriptor() != null)   store.deleteResource(cube.getDescriptor().getResourcePath());
  store.deleteResource(cube.getResourcePath());
  ProjectManager.getInstance(config).removeCubeFromProjects(cubeName);
  CubeRealizationManager.getInstance(config).loadAllProjects();
  this.afterCubeDroped(cube,projects);
  return cube;
}
Program: 63251
Project: 63251
Buggy source:
public List<CubeInstance> listAllCubes(String project){
  project=ProjectInstance.getNormalizedProjectName(project);
  HashSet<CubeInstance> ret=new HashSet<CubeInstance>();
  ProjectInstance projectInstance=getProject(project);
  if (projectInstance != null) {
    for (    String cubeName : projectInstance.getCubes()) {
      CubeInstance cube=CubeManager.getInstance(config).getCube(cubeName);
      if (null != cube) {
        ret.add(cube);
      }
 else {
        logger.error("String_Node_Str" + cubeName);
      }
    }
  }
  return new ArrayList<CubeInstance>(ret);
}

Fixed version (ground truth):
public List<CubeInstance> listAllCubes(ProjectInstance projectInstance){
  if (projectInstance == null) {
    return Collections.emptyList();
  }
  HashSet<CubeInstance> ret=new HashSet<CubeInstance>();
  for (  String cubeName : projectInstance.getCubes()) {
    CubeInstance cube=CubeManager.getInstance(config).getCube(cubeName);
    if (null != cube) {
      ret.add(cube);
    }
 else {
      logger.error("String_Node_Str" + cubeName);
    }
  }
  return new ArrayList<CubeInstance>(ret);
}
Program: 63252
Project: 63252
Buggy source:
private synchronized ProjectInstance loadProject(String path,boolean triggerUpdate) throws IOException {
  ResourceStore store=getStore();
  logger.debug("String_Node_Str" + store.getReadableResourcePath(path));
  ProjectInstance projectInstance=store.getResource(path,ProjectInstance.class,PROJECT_SERIALIZER);
  projectInstance.init();
  if (StringUtils.isBlank(projectInstance.getName())) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (triggerUpdate) {
    projectMap.put(projectInstance.getName().toUpperCase(),projectInstance);
  }
 else {
    projectMap.putLocal(projectInstance.getName().toUpperCase(),projectInstance);
  }
  return projectInstance;
}

Fixed version (ground truth):
public void loadProject(ProjectInstance project) throws IOException {
  loadTables(project);
}
Program: 63253
Project: 63253
Buggy source:
private synchronized void loadTables(String path) throws IOException {
  ResourceStore store=getStore();
  logger.debug("String_Node_Str" + store.getReadableResourcePath(path));
  ProjectInstance projectInstance=store.getResource(path,ProjectInstance.class,PROJECT_SERIALIZER);
  projectInstance.init();
  String project=ProjectInstance.getNormalizedProjectName(projectInstance.getName());
  projectTables.removeAll(project);
  for (  CubeInstance cubeInstance : this.listAllCubes(projectInstance.getName())) {
    markExposedTablesAndColumns(projectInstance.getName(),cubeInstance);
    mapTableToCube(projectInstance,cubeInstance);
  }
}

Fixed version (ground truth):
private synchronized void loadTables(ProjectInstance projectInstance) throws IOException {
  String project=ProjectInstance.getNormalizedProjectName(projectInstance.getName());
  projectTables.removeAll(project);
  for (  CubeInstance cubeInstance : this.listAllCubes(projectInstance.getName())) {
    markExposedTablesAndColumns(projectInstance.getName(),cubeInstance);
    mapTableToCube(projectInstance,cubeInstance);
  }
}
Program: 63254
Project: 63254
Buggy source:
private void loadAllProjects() throws IOException {
  ResourceStore store=getStore();
  List<String> paths=store.collectResourceRecursively(ResourceStore.PROJECT_RESOURCE_ROOT,"String_Node_Str");
  logger.debug("String_Node_Str" + store.getReadableResourcePath(ResourceStore.PROJECT_RESOURCE_ROOT));
  for (  String path : paths) {
    loadProject(path,false);
    loadTables(path);
  }
  logger.debug("String_Node_Str" + paths.size() + "String_Node_Str");
}

Fixed version (ground truth):
public final void loadAllProjects() throws IOException {
  List<ProjectInstance> projectInstances=ProjectManager.getInstance(config).listAllProjects();
  for (  ProjectInstance projectInstance : projectInstances) {
    loadTables(projectInstance);
  }
  logger.debug("String_Node_Str" + projectInstances.size() + "String_Node_Str");
}
Program: 63255
Project: 63255
Buggy source:
public ProjectInstance getProject(String projectName){
  if (projectName == null)   return null;
  projectName=ProjectInstance.getNormalizedProjectName(projectName);
  return projectMap.get(projectName);
}

Fixed version (ground truth):
private ProjectInstance getProject(String projectName){
  return ProjectManager.getInstance(config).getProject(projectName);
}
Program: 63256
Project: 63256
Buggy source:
private void saveResource(ProjectInstance proj) throws IOException {
  ResourceStore store=getStore();
  store.putResource(proj.getResourcePath(),proj,PROJECT_SERIALIZER);
  afterProjectUpdated(proj);
}

Fixed version (ground truth):
private void saveResource(ProjectInstance projectInstance) throws IOException {
  getProjectManager().updateProject(projectInstance);
}
Program: 63257
Project: 63257
Buggy source:
@Before public void before() throws Exception {
  SSHClient hadoopCli=new SSHClient(getHadoopCliHostname(),getHadoopCliUsername(),getHadoopCliPassword(),null);
  removeHdfsDir(hadoopCli,mrOutputDir1);
  removeHdfsDir(hadoopCli,mrOutputDir2);
  MetadataManager.removeInstance(KylinConfig.getInstanceFromEnv());
  CubeManager.removeInstance(KylinConfig.getInstanceFromEnv());
  ProjectManager.removeInstance(KylinConfig.getInstanceFromEnv());
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  SSHClient hadoopCli=new SSHClient(getHadoopCliHostname(),getHadoopCliUsername(),getHadoopCliPassword());
  removeHdfsDir(hadoopCli,mrOutputDir1);
  removeHdfsDir(hadoopCli,mrOutputDir2);
  MetadataManager.removeInstance(KylinConfig.getInstanceFromEnv());
  CubeManager.removeInstance(KylinConfig.getInstanceFromEnv());
  ProjectManager.removeInstance(KylinConfig.getInstanceFromEnv());
}