Program: 63349
Project: 63349
Buggy source:
private static void doOpt(Opt opt) throws IOException, InterruptedException {
  logger.info("String_Node_Str" + opt.toString());
switch (opt.type) {
case COPY_FILE_IN_META:
{
      String item=(String)opt.params[0];
      InputStream inputStream=srcStore.getResource(item);
      long ts=srcStore.getResourceTimestamp(item);
      dstStore.putResource(item,inputStream,ts);
      inputStream.close();
      logger.info("String_Node_Str" + item + "String_Node_Str");
      break;
    }
case COPY_DICT_OR_SNAPSHOT:
{
    String item=(String)opt.params[0];
    if (item.toLowerCase().endsWith("String_Node_Str")) {
      DictionaryManager dstDictMgr=DictionaryManager.getInstance(dstConfig);
      DictionaryManager srcDicMgr=DictionaryManager.getInstance(srcConfig);
      DictionaryInfo dictSrc=srcDicMgr.getDictionaryInfo(item);
      DictionaryInfo dictSaved=dstDictMgr.trySaveNewDict(dictSrc.getDictionaryObject(),dictSrc);
      if (dictSaved == dictSrc) {
        logger.info("String_Node_Str" + item + "String_Node_Str");
      }
 else {
        String cubeName=(String)opt.params[1];
        String cubeResPath=CubeInstance.concatResourcePath(cubeName);
        Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
        CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
        for (        CubeSegment segment : cube.getSegments()) {
          for (          Map.Entry<String,String> entry : segment.getDictionaries().entrySet()) {
            if (entry.getValue().equalsIgnoreCase(item)) {
              entry.setValue(dictSaved.getResourcePath());
            }
          }
        }
        dstStore.putResource(cubeResPath,cube,cubeSerializer);
        logger.info("String_Node_Str" + item + "String_Node_Str"+ dictSaved.getResourcePath()+ "String_Node_Str");
      }
    }
 else     if (item.toLowerCase().endsWith("String_Node_Str")) {
      SnapshotManager dstSnapMgr=SnapshotManager.getInstance(dstConfig);
      SnapshotManager srcSnapMgr=SnapshotManager.getInstance(srcConfig);
      SnapshotTable snapSrc=srcSnapMgr.getSnapshotTable(item);
      SnapshotTable snapSaved=dstSnapMgr.trySaveNewSnapshot(snapSrc);
      if (snapSaved == snapSrc) {
        logger.info("String_Node_Str" + item + "String_Node_Str");
      }
 else {
        String cubeName=(String)opt.params[1];
        String cubeResPath=CubeInstance.concatResourcePath(cubeName);
        Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
        CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
        for (        CubeSegment segment : cube.getSegments()) {
          for (          Map.Entry<String,String> entry : segment.getSnapshots().entrySet()) {
            if (entry.getValue().equalsIgnoreCase(item)) {
              entry.setValue(snapSaved.getResourcePath());
            }
          }
        }
        dstStore.putResource(cubeResPath,cube,cubeSerializer);
        logger.info("String_Node_Str" + item + "String_Node_Str"+ snapSaved.getResourcePath()+ "String_Node_Str");
      }
    }
 else {
      logger.error("String_Node_Str" + item);
      logger.info("String_Node_Str");
    }
    break;
  }
case RENAME_FOLDER_IN_HDFS:
{
  String srcPath=(String)opt.params[0];
  String dstPath=(String)opt.params[1];
  hdfsFS.rename(new Path(srcPath),new Path(dstPath));
  logger.info("String_Node_Str" + srcPath + "String_Node_Str"+ dstPath);
  break;
}
case RENAME_TABLE_IN_HBASE:
{
String oldTableName=(String)opt.params[0];
String newTableName=(String)opt.params[1];
String snapshotName="String_Node_Str" + oldTableName;
hbaseAdmin.disableTable(oldTableName);
hbaseAdmin.snapshot(snapshotName,oldTableName);
hbaseAdmin.cloneSnapshot(snapshotName,newTableName);
hbaseAdmin.deleteSnapshot(snapshotName);
hbaseAdmin.deleteTable(oldTableName);
logger.info("String_Node_Str" + oldTableName + "String_Node_Str"+ newTableName);
break;
}
case CHANGE_HTABLE_NAME_IN_CUBE:
{
String cubeName=(String)opt.params[0];
@SuppressWarnings("String_Node_Str") HashMap<String,String> renamedHtables=(HashMap<String,String>)opt.params[1];
String cubeResPath=CubeInstance.concatResourcePath(cubeName);
Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
for (CubeSegment segment : cube.getSegments()) {
String htable=segment.getStorageLocationIdentifier().trim();
segment.setStorageLocationIdentifier(renamedHtables.get(htable));
}
dstStore.putResource(cubeResPath,cube,cubeSerializer);
logger.info("String_Node_Str" + cubeName + "String_Node_Str");
break;
}
case ADD_INTO_PROJECT:
{
String cubeName=(String)opt.params[0];
String projectName=(String)opt.params[1];
String projectResPath=ProjectInstance.concatResourcePath(projectName);
Serializer<ProjectInstance> projectSerializer=new JsonSerializer<ProjectInstance>(ProjectInstance.class);
ProjectInstance project=dstStore.getResource(projectResPath,ProjectInstance.class,projectSerializer);
project.removeCube(cubeName);
project.addCube(cubeName);
dstStore.putResource(projectResPath,project,projectSerializer);
logger.info("String_Node_Str" + projectName + "String_Node_Str");
break;
}
case ALTER_TABLE_COPROCESSOR:
{
String htableName=(String)opt.params[0];
DeployCoprocessorCLI.resetCoprocessor(htableName,hbaseAdmin,dstCoprocessorPath);
logger.info("String_Node_Str" + htableName + "String_Node_Str"+ dstCoprocessorPath);
break;
}
}
}

Fixed version (ground truth):
private static void doOpt(Opt opt) throws IOException, InterruptedException {
  logger.info("String_Node_Str" + opt.toString());
switch (opt.type) {
case COPY_FILE_IN_META:
{
      String item=(String)opt.params[0];
      InputStream inputStream=srcStore.getResource(item);
      long ts=srcStore.getResourceTimestamp(item);
      dstStore.putResource(item,inputStream,ts);
      inputStream.close();
      logger.info("String_Node_Str" + item + "String_Node_Str");
      break;
    }
case COPY_DICT_OR_SNAPSHOT:
{
    String item=(String)opt.params[0];
    if (item.toLowerCase().endsWith("String_Node_Str")) {
      DictionaryManager dstDictMgr=DictionaryManager.getInstance(dstConfig);
      DictionaryManager srcDicMgr=DictionaryManager.getInstance(srcConfig);
      DictionaryInfo dictSrc=srcDicMgr.getDictionaryInfo(item);
      long ts=dictSrc.getLastModified();
      dictSrc.setLastModified(0);
      DictionaryInfo dictSaved=dstDictMgr.trySaveNewDict(dictSrc.getDictionaryObject(),dictSrc);
      dictSrc.setLastModified(ts);
      if (dictSaved == dictSrc) {
        logger.info("String_Node_Str" + item + "String_Node_Str");
      }
 else {
        String cubeName=(String)opt.params[1];
        String cubeResPath=CubeInstance.concatResourcePath(cubeName);
        Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
        CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
        for (        CubeSegment segment : cube.getSegments()) {
          for (          Map.Entry<String,String> entry : segment.getDictionaries().entrySet()) {
            if (entry.getValue().equalsIgnoreCase(item)) {
              entry.setValue(dictSaved.getResourcePath());
            }
          }
        }
        dstStore.putResource(cubeResPath,cube,cubeSerializer);
        logger.info("String_Node_Str" + item + "String_Node_Str"+ dictSaved.getResourcePath()+ "String_Node_Str");
      }
    }
 else     if (item.toLowerCase().endsWith("String_Node_Str")) {
      SnapshotManager dstSnapMgr=SnapshotManager.getInstance(dstConfig);
      SnapshotManager srcSnapMgr=SnapshotManager.getInstance(srcConfig);
      SnapshotTable snapSrc=srcSnapMgr.getSnapshotTable(item);
      long ts=snapSrc.getLastModified();
      snapSrc.setLastModified(0);
      SnapshotTable snapSaved=dstSnapMgr.trySaveNewSnapshot(snapSrc);
      snapSrc.setLastModified(ts);
      if (snapSaved == snapSrc) {
        logger.info("String_Node_Str" + item + "String_Node_Str");
      }
 else {
        String cubeName=(String)opt.params[1];
        String cubeResPath=CubeInstance.concatResourcePath(cubeName);
        Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
        CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
        for (        CubeSegment segment : cube.getSegments()) {
          for (          Map.Entry<String,String> entry : segment.getSnapshots().entrySet()) {
            if (entry.getValue().equalsIgnoreCase(item)) {
              entry.setValue(snapSaved.getResourcePath());
            }
          }
        }
        dstStore.putResource(cubeResPath,cube,cubeSerializer);
        logger.info("String_Node_Str" + item + "String_Node_Str"+ snapSaved.getResourcePath()+ "String_Node_Str");
      }
    }
 else {
      logger.error("String_Node_Str" + item);
      logger.info("String_Node_Str");
    }
    break;
  }
case RENAME_FOLDER_IN_HDFS:
{
  String srcPath=(String)opt.params[0];
  String dstPath=(String)opt.params[1];
  hdfsFS.rename(new Path(srcPath),new Path(dstPath));
  logger.info("String_Node_Str" + srcPath + "String_Node_Str"+ dstPath);
  break;
}
case RENAME_TABLE_IN_HBASE:
{
String oldTableName=(String)opt.params[0];
String newTableName=(String)opt.params[1];
String snapshotName="String_Node_Str" + oldTableName;
hbaseAdmin.disableTable(oldTableName);
hbaseAdmin.snapshot(snapshotName,oldTableName);
hbaseAdmin.cloneSnapshot(snapshotName,newTableName);
hbaseAdmin.deleteSnapshot(snapshotName);
hbaseAdmin.deleteTable(oldTableName);
logger.info("String_Node_Str" + oldTableName + "String_Node_Str"+ newTableName);
break;
}
case CHANGE_HTABLE_NAME_IN_CUBE:
{
String cubeName=(String)opt.params[0];
@SuppressWarnings("String_Node_Str") HashMap<String,String> renamedHtables=(HashMap<String,String>)opt.params[1];
String cubeResPath=CubeInstance.concatResourcePath(cubeName);
Serializer<CubeInstance> cubeSerializer=new JsonSerializer<CubeInstance>(CubeInstance.class);
CubeInstance cube=dstStore.getResource(cubeResPath,CubeInstance.class,cubeSerializer);
for (CubeSegment segment : cube.getSegments()) {
String htable=segment.getStorageLocationIdentifier().trim();
segment.setStorageLocationIdentifier(renamedHtables.get(htable));
}
dstStore.putResource(cubeResPath,cube,cubeSerializer);
logger.info("String_Node_Str" + cubeName + "String_Node_Str");
break;
}
case ADD_INTO_PROJECT:
{
String cubeName=(String)opt.params[0];
String projectName=(String)opt.params[1];
String projectResPath=ProjectInstance.concatResourcePath(projectName);
Serializer<ProjectInstance> projectSerializer=new JsonSerializer<ProjectInstance>(ProjectInstance.class);
ProjectInstance project=dstStore.getResource(projectResPath,ProjectInstance.class,projectSerializer);
project.removeCube(cubeName);
project.addCube(cubeName);
dstStore.putResource(projectResPath,project,projectSerializer);
logger.info("String_Node_Str" + projectName + "String_Node_Str");
break;
}
case ALTER_TABLE_COPROCESSOR:
{
String htableName=(String)opt.params[0];
DeployCoprocessorCLI.resetCoprocessor(htableName,hbaseAdmin,dstCoprocessorPath);
logger.info("String_Node_Str" + htableName + "String_Node_Str"+ dstCoprocessorPath);
break;
}
}
}