Program: 137701
Project: 137701
Buggy source:
/** 
 * DOC xqliu Comment method "createAndStoreUDI".
 * @param parameters
 * @param selectionFolder
 */
private static TypedReturnCode<Object> createAndStoreUDI(UDIParameters parameters,IFolder selectionFolder){
  IndicatorDefinition indDef=UDIHelper.createUDI(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status,parameters.category,parameters.javaClassName,parameters.javaJarPath);
  for (  String key : parameters.regex.keySet()) {
    TdExpression expression=BooleanExpressionHelper.createTdExpression(key,parameters.regex.get(key));
    indDef.getSqlGenericExpression().add(expression);
  }
  boolean validStatus=UDIHelper.isUDIValid(indDef);
  TaggedValueHelper.setValidStatus(validStatus,indDef);
  Map<String,String> paraMap=parameters.getParaMap();
  if (!paraMap.isEmpty()) {
    for (    String key : paraMap.keySet()) {
      String value=paraMap.get(key);
      IndicatorDefinitionParameter idPara=DefinitionFactory.eINSTANCE.createIndicatorDefinitionParameter();
      idPara.setKey(key);
      idPara.setValue(value);
      indDef.getIndicatorDefinitionParameter().add(idPara);
    }
  }
  try {
    String[] folderNames=parameters.relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  IFile pfile=selectionFolder.getFile(fname);
  return ElementWriterFactory.getInstance().createIndicatorDefinitionWriter().create(indDef,selectionFolder);
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createAndStoreUDI".
 * @param parameters
 * @param selectionFolder
 */
private static TypedReturnCode<Object> createAndStoreUDI(UDIParameters parameters,IFolder selectionFolder){
  IndicatorDefinition indDef=UDIHelper.createUDI(parameters.name,parameters.auther,parameters.description,parameters.purpose,parameters.status,parameters.category,parameters.javaClassName,parameters.javaJarPath);
  for (  String key : parameters.regex.keySet()) {
    TdExpression expression=BooleanExpressionHelper.createTdExpression(key,parameters.regex.get(key));
    indDef.getSqlGenericExpression().add(expression);
  }
  boolean validStatus=UDIHelper.isUDIValid(indDef);
  TaggedValueHelper.setValidStatus(validStatus,indDef);
  Map<String,String> paraMap=parameters.getParaMap();
  if (!paraMap.isEmpty()) {
    for (    String key : paraMap.keySet()) {
      String value=paraMap.get(key);
      IndicatorDefinitionParameter idPara=DefinitionFactory.eINSTANCE.createIndicatorDefinitionParameter();
      idPara.setKey(key);
      idPara.setValue(value);
      indDef.getIndicatorDefinitionParameter().add(idPara);
    }
  }
  try {
    String[] folderNames=parameters.relativePath.split("String_Node_Str");
    for (    String folderName : folderNames) {
      IFolder folder=selectionFolder.getFolder(folderName);
      if (!folder.exists()) {
        folder.create(false,true,null);
      }
      selectionFolder=folder;
    }
  }
 catch (  CoreException e) {
    log.error(e,e);
  }
  return ElementWriterFactory.getInstance().createIndicatorDefinitionWriter().create(indDef,selectionFolder);
}