nus-yam/ex-repair huggingface dataset:
Program: 137354
Project: 137354
Buggy source:
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg=Messages.getString("String_Node_Str");
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg=Messages.getString("String_Node_Str",dataProvider);
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection) && !ConnectionUtils.isOdbcOracle(connection)) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg=Messages.getString("String_Node_Str");
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg=Messages.getString("String_Node_Str",dataProvider);
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection) && !ConnectionUtils.isOdbcOracle(connection) && StringUtils.isNotEmpty(catName)&& dbms().supportCatalogSelection()) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}
Program: 137355
Project: 137355
Buggy source:
/** 
 * check whether DND is allowed.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean allowDND(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  if (sourceCount == 1 || targetCount == 1) {
    return false;
  }
  if (isForbidNode(sourceNode)) {
    return false;
  }
  if (isSubTypeOfTargetNode(sourceNode,targetNode)) {
    return false;
  }
  if (ProxyRepositoryFactory.getInstance().getStatus(sourceNode.getObject()) == ERepositoryStatus.DELETED) {
    return false;
  }
  if (sourceNode.equals(targetNode)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * check whether DND is allowed.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean allowDND(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  if (sourceCount == 1 || targetCount == 1) {
    return false;
  }
  if (sourceNode.equals(targetNode)) {
    return false;
  }
  if (isForbidNode(sourceNode)) {
    return false;
  }
  if (isSubTypeOfTargetNode(sourceNode,targetNode)) {
    return false;
  }
  if (!isSameType(sourceNode,targetNode)) {
    return false;
  }
  if (ProxyRepositoryFactory.getInstance().getStatus(sourceNode.getObject()) == ERepositoryStatus.DELETED) {
    return false;
  }
  if (sourceNode.getParent().equals(targetNode)) {
    return false;
  }
  if (targetNode.getParent().equals(sourceNode)) {
    return false;
  }
  if (sourceNode.getType() == ENodeType.SIMPLE_FOLDER) {
    if (!canMoveFolderNode(sourceNode,targetNode)) {
      return false;
    }
  }
  return true;
}
Program: 137356
Project: 137356
Buggy source:
/** 
 * move Folder Node.
 * @param sourceNode
 * @param targetNode
 * @throws PersistenceException
 */
private void moveFolderRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IPath oldPath=null;
  List<String> jrxmlFileNames=null;
  List<JrxmlTempleteRepNode> jrxmlFileRepNodes=new ArrayList<JrxmlTempleteRepNode>();
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    oldPath=RepositoryNodeHelper.getPath(sourceNode);
    jrxmlFileRepNodes=RepositoryNodeHelper.getJrxmlFileRepNodes(sourceNode,true);
    jrxmlFileNames=RepNodeUtils.getListOfJrxmlNameWithPath(oldPath,jrxmlFileRepNodes);
  }
  if (!canMoveNode(sourceNode,targetNode)) {
    return;
  }
  moveFolder(sourceNode,targetNode);
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    IPath newPath=RepositoryNodeHelper.getPath(targetNode);
    List<String> jrxmlFileNamesAfterMove=new ArrayList<String>();
    for (    JrxmlTempleteRepNode jrxml : jrxmlFileRepNodes) {
      IPath relativeTo=RepositoryNodeHelper.getPath(jrxml.getParent()).makeRelativeTo(oldPath);
      IPath tempPath=newPath.append(RepNodeUtils.getSeparator()).append(sourceNode.getLabel()).append(RepNodeUtils.getSeparator());
      if (relativeTo.segmentCount() > 0) {
        tempPath=tempPath.append(relativeTo).append(RepNodeUtils.getSeparator());
      }
      jrxmlFileNamesAfterMove.add(tempPath.append(RepositoryNodeHelper.getFileNameOfTheNode(jrxml)).toOSString());
    }
    RepNodeUtils.updateJrxmlRelatedReport(jrxmlFileNames,jrxmlFileNamesAfterMove);
  }
}

Fixed version (ground truth):
/** 
 * move Folder Node.
 * @param sourceNode
 * @param targetNode
 * @throws PersistenceException
 */
private void moveFolderRepNode(IRepositoryNode sourceNode,IRepositoryNode targetNode) throws PersistenceException {
  IPath oldPath=null;
  List<String> jrxmlFileNames=null;
  List<JrxmlTempleteRepNode> jrxmlFileRepNodes=new ArrayList<JrxmlTempleteRepNode>();
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    oldPath=RepositoryNodeHelper.getPath(sourceNode);
    jrxmlFileRepNodes=RepositoryNodeHelper.getJrxmlFileRepNodes(sourceNode,true);
    jrxmlFileNames=RepNodeUtils.getListOfJrxmlNameWithPath(oldPath,jrxmlFileRepNodes);
  }
  moveFolder(sourceNode,targetNode);
  if (sourceNode instanceof JrxmlTempSubFolderNode) {
    IPath newPath=RepositoryNodeHelper.getPath(targetNode);
    List<String> jrxmlFileNamesAfterMove=new ArrayList<String>();
    for (    JrxmlTempleteRepNode jrxml : jrxmlFileRepNodes) {
      IPath relativeTo=RepositoryNodeHelper.getPath(jrxml.getParent()).makeRelativeTo(oldPath);
      IPath tempPath=newPath.append(RepNodeUtils.getSeparator()).append(sourceNode.getLabel()).append(RepNodeUtils.getSeparator());
      if (relativeTo.segmentCount() > 0) {
        tempPath=tempPath.append(relativeTo).append(RepNodeUtils.getSeparator());
      }
      jrxmlFileNamesAfterMove.add(tempPath.append(RepositoryNodeHelper.getFileNameOfTheNode(jrxml)).toOSString());
    }
    RepNodeUtils.updateJrxmlRelatedReport(jrxmlFileNames,jrxmlFileNamesAfterMove);
  }
}
Program: 137357
Project: 137357
Buggy source:
@Override public Boolean handleDrop(IRepositoryNode targetNode){
  Boolean isHandleOK=Boolean.FALSE;
  try {
    IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
    for (    IRepositoryNode sourceNode : selectedRepositoryNodes) {
      if (haveLockedItems(sourceNode)) {
        return isHandleOK;
      }
      if (!isSameType(sourceNode,targetNode)) {
        MessageDialog.openWarning(PlatformUI.getWorkbench().getDisplay().getActiveShell(),DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
        return isHandleOK;
      }
    }
    moveRepositoryNodes(selectedRepositoryNodes,targetNode);
    if (DQRepositoryNode.isOnFilterring()) {
      RepositoryNodeHelper.fillTreeList(null);
      RepositoryNodeHelper.setFilteredNode(RepositoryNodeHelper.getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
    }
    isHandleOK=Boolean.TRUE;
  }
 catch (  PersistenceException e) {
    if (log.isInfoEnabled()) {
      log.info(e.toString());
    }
    MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),DefaultMessagesImpl.getString("String_Node_Str"),e.getMessage());
    isHandleOK=Boolean.FALSE;
  }
  ProxyRepositoryManager.getInstance().refresh();
  return isHandleOK;
}

Fixed version (ground truth):
@Override public Boolean handleDrop(IRepositoryNode targetNode){
  Boolean isHandleOK=Boolean.FALSE;
  try {
    IRepositoryNode[] selectedRepositoryNodes=getSelectedRepositoryNodes();
    for (    IRepositoryNode sourceNode : selectedRepositoryNodes) {
      if (haveLockedItems(sourceNode)) {
        return isHandleOK;
      }
    }
    moveRepositoryNodes(selectedRepositoryNodes,targetNode);
    if (DQRepositoryNode.isOnFilterring()) {
      RepositoryNodeHelper.fillTreeList(null);
      RepositoryNodeHelper.setFilteredNode(RepositoryNodeHelper.getRootNode(ERepositoryObjectType.TDQ_DATA_PROFILING,true));
    }
    isHandleOK=Boolean.TRUE;
  }
 catch (  PersistenceException e) {
    if (log.isInfoEnabled()) {
      log.info(e.toString());
    }
    MessageDialog.openError(PlatformUI.getWorkbench().getDisplay().getActiveShell(),DefaultMessagesImpl.getString("String_Node_Str"),e.getMessage());
    isHandleOK=Boolean.FALSE;
  }
  ProxyRepositoryManager.getInstance().refresh();
  return isHandleOK;
}
Program: 137358
Project: 137358
Buggy source:
/** 
 * check whether sourceNode and targetNode is the same Type.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean isSameType(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  String sourceString=sourcePath.removeLastSegments(sourceCount - 2).toOSString();
  String targetString=targetPath.removeLastSegments(targetCount - 2).toOSString();
  ERepositoryObjectType sourceType=sourceNode.getContentType();
  ERepositoryObjectType targetentType=targetNode.getContentType();
  if (sourceType == null || targetentType == null || !sourceType.equals(targetentType)) {
    return false;
  }
  return sourceString.equals(targetString);
}

Fixed version (ground truth):
/** 
 * check whether sourceNode and targetNode is the same Type.
 * @param sourceNode
 * @param targetNode
 * @return
 */
private boolean isSameType(IRepositoryNode sourceNode,IRepositoryNode targetNode){
  ERepositoryObjectType sourceType=sourceNode.getContentType();
  ERepositoryObjectType targetentType=targetNode.getContentType();
  if (sourceType == null || targetentType == null || !sourceType.equals(targetentType)) {
    return false;
  }
  IPath sourcePath=WorkbenchUtils.getPath(sourceNode);
  IPath targetPath=WorkbenchUtils.getPath(targetNode);
  int sourceCount=sourcePath.segmentCount();
  int targetCount=targetPath.segmentCount();
  String sourceString=sourcePath.removeLastSegments(sourceCount - 2).toOSString();
  String targetString=targetPath.removeLastSegments(targetCount - 2).toOSString();
  return sourceString.equals(targetString);
}
Program: 137360
Project: 137360
Buggy source:
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg=Messages.getString("String_Node_Str");
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg=Messages.getString("String_Node_Str",dataProvider);
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection) && !ConnectionUtils.isOdbcOracle(connection)) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  DataProvider dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg=Messages.getString("String_Node_Str");
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  Indicator[] indics=this.getAllIndicators();
  if (indics.length == 0) {
    String msg=Messages.getString("String_Node_Str",dataProvider);
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  for (  Indicator indicator : indics) {
    SchemaIndicator schemaIndicator=DataqualitySwitchHelper.SCHEMA_SWITCH.doSwitch(indicator);
    if (schemaIndicator == null) {
      continue;
    }
    Schema schema=(Schema)schemaIndicator.getAnalyzedElement();
    String catName=schema.getName();
    if (!checkSchema(schema)) {
      ok.setReturnCode(Messages.getString("String_Node_Str",catName),false);
      return ok;
    }
    EObject container=schema.eContainer();
    if (container != null) {
      Catalog catalog=SwitchHelpers.CATALOG_SWITCH.doSwitch(container);
      if (catalog != null) {
        catName=catalog.getName();
      }
    }
    if (!ConnectionUtils.isOdbcProgress(connection) && !ConnectionUtils.isOdbcOracle(connection) && StringUtils.isNotEmpty(catName)&& dbms().supportCatalogSelection()) {
      connection.setCatalog(catName);
    }
    evalSchemaIndicLow(null,schemaIndicator,null,schema,ok);
  }
  return ok;
}
Program: 137361
Project: 137361
Buggy source:
/** 
 * check the inString is a validate value.
 * @param inString
 * @return
 */
public boolean isOutOfValue(String inString){
  if (inString.equals("String_Node_Str")) {
    return true;
  }
  boolean isOutOfValue=false;
  isPercent=inString.indexOf('%') > 0;
  if (isPercent) {
    NumberFormat nFromat=NumberFormat.getPercentInstance();
    try {
      Number number=nFromat.parse(inString);
      if (number instanceof Double) {
        Double doubleString=(Double)number;
        if (doubleString < 0 || doubleString > 1) {
          isOutOfValue=true;
        }
      }
 else       if (number instanceof Long) {
        Long longString=(Long)number;
        if (longString < 0 || longString > 1) {
          isOutOfValue=true;
        }
      }
    }
 catch (    ParseException e) {
      isOutOfValue=false;
    }
  }
 else {
    Double douString=Double.valueOf(inString);
    if (douString < 0) {
      isOutOfValue=true;
    }
  }
  return isOutOfValue;
}

Fixed version (ground truth):
/** 
 * check the inString is a validate value.
 * @param inString
 * @return
 */
public boolean isOutOfValue(String inString){
  if (inString.equals(PluginConstant.NA_STRING)) {
    return true;
  }
  boolean isOutOfValue=false;
  isPercent=inString.indexOf('%') > 0;
  if (isPercent) {
    NumberFormat nFromat=NumberFormat.getPercentInstance();
    try {
      Number number=nFromat.parse(inString);
      if (number instanceof Double) {
        Double doubleString=(Double)number;
        if (doubleString < 0 || doubleString > 1) {
          isOutOfValue=true;
        }
      }
 else       if (number instanceof Long) {
        Long longString=(Long)number;
        if (longString < 0 || longString > 1) {
          isOutOfValue=true;
        }
      }
    }
 catch (    ParseException e) {
      isOutOfValue=false;
    }
  }
 else {
    Double douString=Double.valueOf(inString);
    if (douString < 0) {
      isOutOfValue=true;
    }
  }
  return isOutOfValue;
}
Program: 137362
Project: 137362
Buggy source:
public String getPersent(){
  if (percent != null) {
    if (Double.isNaN(percent) || Double.isInfinite(percent)) {
      return "String_Node_Str";
    }
 else {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public String getPersent(){
  if (percent != null) {
    if (Double.isNaN(percent) || Double.isInfinite(percent)) {
      return PluginConstant.NA_STRING;
    }
 else {
      return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
    }
  }
 else {
    return null;
  }
}
Program: 137363
Project: 137363
Buggy source:
public String getPerMatch(){
  Double match=Double.parseDouble(getNumMatch());
  return StringFormatUtil.format(match / getSum(),StringFormatUtil.PERCENT).toString();
}

Fixed version (ground truth):
public String getPerMatch(){
  Double match=Double.parseDouble(getNumMatch());
  Double percent=match / getSum();
  if (Double.isNaN(percent) || Double.isInfinite(percent)) {
    return PluginConstant.NA_STRING;
  }
  return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
}
Program: 137364
Project: 137364
Buggy source:
public String getPerNoMatch(){
  Double nomatch=Double.parseDouble(getNumNoMatch());
  return StringFormatUtil.format(nomatch / getSum(),StringFormatUtil.PERCENT).toString();
}

Fixed version (ground truth):
public String getPerNoMatch(){
  Double nomatch=Double.parseDouble(getNumNoMatch());
  Double percent=nomatch / getSum();
  if (Double.isNaN(percent) || Double.isInfinite(percent)) {
    return PluginConstant.NA_STRING;
  }
  return StringFormatUtil.format(percent,StringFormatUtil.PERCENT).toString();
}
Program: 137367
Project: 137367
Buggy source:
public void openIndicatorOptionDialog(Shell shell,TreeItem indicatorItem){
  if (isDirty()) {
    masterPage.doSave(null);
  }
  Indicator indicator=(Indicator)indicatorItem.getData(INDICATOR_KEY);
  ColumnSetIndicatorUnit indicatorUnit=new ColumnSetIndicatorUnit(IndicatorEnum.findIndicatorEnum(indicator.eClass()),indicator);
  IndicatorOptionsWizard wizard=new IndicatorOptionsWizard(indicatorUnit);
  if (indicatorUnit.isExsitingForm()) {
    String href=FormEnum.getFirstFormHelpHref(indicatorUnit);
    OpeningHelpWizardDialog optionDialog=new OpeningHelpWizardDialog(shell,wizard,href);
    if (Window.OK == optionDialog.open()) {
      masterPage.setDirty(wizard.isDirty());
      createIndicatorParameters(indicatorItem,indicator);
    }
  }
 else {
    MessageDialogWithToggle.openInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void openIndicatorOptionDialog(Shell shell,TreeItem indicatorItem){
  if (isDirty()) {
    masterPage.doSave(null);
  }
  ColumnSetIndicatorUnit indicatorUnit=(ColumnSetIndicatorUnit)indicatorItem.getData(INDICATOR_KEY);
  IndicatorOptionsWizard wizard=new IndicatorOptionsWizard(indicatorUnit);
  if (indicatorUnit.isExsitingForm()) {
    String href=FormEnum.getFirstFormHelpHref(indicatorUnit);
    OpeningHelpWizardDialog optionDialog=new OpeningHelpWizardDialog(shell,wizard,href);
    if (Window.OK == optionDialog.open()) {
      masterPage.setDirty(wizard.isDirty());
      createIndicatorParameters(indicatorItem,indicatorUnit.getIndicator());
    }
  }
 else {
    MessageDialogWithToggle.openInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}
Program: 137368
Project: 137368
Buggy source:
public boolean isExsitingForm(){
  if (getForms().length > 0) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isExsitingForm(){
  if (getForms() != null) {
    return true;
  }
  return false;
}
Program: 137369
Project: 137369
Buggy source:
/** 
 * DOC bZhou Comment method "getFileResource".
 * @param file
 * @return get null if the file is not exist.
 */
public synchronized Resource getFileResource(IFile file){
  if (file.exists()) {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    Resource res=EMFSharedResources.getInstance().getResource(uri,false);
    if (EMFSharedResources.getInstance().isNeedReload(res)) {
      res=EMFSharedResources.getInstance().reloadResource(uri);
    }
    return res;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ADD sizhaoliu TDQ-8483
 * @param file
 * @param forceReload
 * @return get null if the file is not exist.
 */
public synchronized Resource getFileResource(IFile file,boolean forceReload){
  if (file.exists()) {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    Resource res=EMFSharedResources.getInstance().getResource(uri,false);
    if (forceReload || EMFSharedResources.getInstance().isNeedReload(res)) {
      res=EMFSharedResources.getInstance().reloadResource(uri);
    }
    return res;
  }
  return null;
}
Program: 137370
Project: 137370
Buggy source:
private void refreshColumnAndData(){
  this.analysisHandler.setSelectedColumns(translateSelectedNodeIntoModelElement());
  updateAllColumnsToKeySection();
  refreshDataFromConnection(true);
  this.setDirty(Boolean.TRUE);
}

Fixed version (ground truth):
private void refreshColumnAndData(){
  ModelElement[] modelElements=translateSelectedNodeIntoModelElement();
  this.analysisHandler.setSelectedColumns(modelElements);
  EList<ModelElement> analyzedElements=this.analysisHandler.getAnalysis().getContext().getAnalysedElements();
  analyzedElements.clear();
  analyzedElements.addAll(Arrays.asList(modelElements));
  updateAllColumnsToKeySection();
  refreshDataFromConnection(true);
  this.setDirty(Boolean.TRUE);
}
Program: 137371
Project: 137371
Buggy source:
/** 
 * DOC bZhou Comment method "getModelElement".
 * @param resource
 * @return
 */
public final ModelElement getModelElement(Resource resource){
  if (resource != null) {
    EList<EObject> contents=resource.getContents();
    if (contents.isEmpty()) {
      log.error(Messages.getString("String_Node_Str") + resource);
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + contents.size());
    }
    for (    EObject object : contents) {
      ModelElement switchObject=doSwitch(object);
      if (switchObject != null) {
        return switchObject;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getModelElement".
 * @param resource
 * @return
 */
public final ModelElement getModelElement(Resource resource){
  if (resource != null) {
    EList<EObject> contents=resource.getContents();
    if (contents.isEmpty()) {
      log.error(Messages.getString("String_Node_Str") + resource);
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + contents.size());
      log.debug("String_Node_Str" + resource.getURI());
    }
    for (    EObject object : contents) {
      ModelElement switchObject=doSwitch(object);
      if (switchObject != null) {
        return switchObject;
      }
    }
  }
  return null;
}
Program: 137372
Project: 137372
Buggy source:
/** 
 * ADD sizhaoliu TDQ-8483
 * @param file
 * @param forceReload
 * @return get null if the file is not exist.
 */
public synchronized Resource getFileResource(IFile file,boolean forceReload){
  if (file.exists()) {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    Resource res=EMFSharedResources.getInstance().getResource(uri,false);
    if (forceReload || EMFSharedResources.getInstance().isNeedReload(res)) {
      res=EMFSharedResources.getInstance().reloadResource(uri);
    }
    return res;
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC bZhou Comment method "getFileResource".
 * @param file
 * @return get null if the file is not exist.
 */
public synchronized Resource getFileResource(IFile file){
  if (file.exists()) {
    URI uri=URI.createPlatformResourceURI(file.getFullPath().toString(),false);
    Resource res=EMFSharedResources.getInstance().getResource(uri,false);
    if (EMFSharedResources.getInstance().isNeedReload(res)) {
      res=EMFSharedResources.getInstance().reloadResource(uri);
    }
    return res;
  }
  return null;
}
Program: 137373
Project: 137373
Buggy source:
public List<Map<String,String>> getBlockingKeysFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForBlockingKeys(matchRuleDefinition);
      ruleValues.addAll(getBlockingKeysFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}

Fixed version (ground truth):
public List<Map<String,String>> getBlockingKeysFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      ruleValues.addAll(getBlockingKeysFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}
Program: 137376
Project: 137376
Buggy source:
/** 
 * DOC sizhaoliu Comment method "getMatchRulesFromFiles".
 * @param files
 * @param retrieveDisplayValue get the display value when this parameter is set to true, otherwise, get thecomponent value.
 * @return
 */
public List<Map<String,String>> getMatchRulesFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      matchExistingColumnForMatchRules(matchRuleDefinition);
      ruleValues.addAll(getMatchRulesFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}

Fixed version (ground truth):
/** 
 * DOC sizhaoliu Comment method "getMatchRulesFromFiles".
 * @param files
 * @param retrieveDisplayValue get the display value when this parameter is set to true, otherwise, get thecomponent value.
 * @return
 */
public List<Map<String,String>> getMatchRulesFromFiles(Object[] files,boolean retrieveDisplayValue){
  List<Map<String,String>> ruleValues=new ArrayList<Map<String,String>>();
  for (  Object rule : files) {
    if (rule instanceof IFile) {
      MatchRuleDefinition matchRuleDefinition=DQRuleResourceFileHelper.getInstance().findMatchRule((IFile)rule);
      ruleValues.addAll(getMatchRulesFromRules(matchRuleDefinition,retrieveDisplayValue));
    }
  }
  return ruleValues;
}
Program: 137377
Project: 137377
Buggy source:
public void openIndicatorOptionDialog(Shell shell,TreeItem indicatorItem){
  if (isDirty()) {
    masterPage.doSave(null);
  }
  Indicator indicator=(Indicator)indicatorItem.getData(INDICATOR_KEY);
  ColumnSetIndicatorUnit indicatorUnit=new ColumnSetIndicatorUnit(IndicatorEnum.findIndicatorEnum(indicator.eClass()),indicator);
  IndicatorOptionsWizard wizard=new IndicatorOptionsWizard(indicatorUnit);
  if (indicatorUnit.isExsitingForm()) {
    String href=FormEnum.getFirstFormHelpHref(indicatorUnit);
    OpeningHelpWizardDialog optionDialog=new OpeningHelpWizardDialog(shell,wizard,href);
    if (Window.OK == optionDialog.open()) {
      masterPage.setDirty(wizard.isDirty());
      createIndicatorParameters(indicatorItem,indicator);
    }
  }
 else {
    MessageDialogWithToggle.openInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void openIndicatorOptionDialog(Shell shell,TreeItem indicatorItem){
  if (isDirty()) {
    masterPage.doSave(null);
  }
  ColumnSetIndicatorUnit indicatorUnit=(ColumnSetIndicatorUnit)indicatorItem.getData(INDICATOR_KEY);
  IndicatorOptionsWizard wizard=new IndicatorOptionsWizard(indicatorUnit);
  if (indicatorUnit.isExsitingForm()) {
    String href=FormEnum.getFirstFormHelpHref(indicatorUnit);
    OpeningHelpWizardDialog optionDialog=new OpeningHelpWizardDialog(shell,wizard,href);
    if (Window.OK == optionDialog.open()) {
      masterPage.setDirty(wizard.isDirty());
      createIndicatorParameters(indicatorItem,indicatorUnit.getIndicator());
    }
  }
 else {
    MessageDialogWithToggle.openInformation(null,DefaultMessagesImpl.getString("String_Node_Str"),DefaultMessagesImpl.getString("String_Node_Str"));
  }
}
Program: 137378
Project: 137378
Buggy source:
public boolean isExsitingForm(){
  if (getForms().length > 0) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isExsitingForm(){
  if (getForms() != null) {
    return true;
  }
  return false;
}
Program: 137379
Project: 137379
Buggy source:
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      continue;
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        if (buffer.length() > 0) {
          buffer.append(separator);
        }
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
  }
  return buffer.toString();
}

Fixed version (ground truth):
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      continue;
    }
    if (buffer.length() > 0) {
      buffer.append(separator);
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
  }
  return buffer.toString();
}
Program: 137380
Project: 137380
Buggy source:
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      continue;
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        if (buffer.length() > 0) {
          buffer.append(separator);
        }
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
  }
  return buffer.toString();
}

Fixed version (ground truth):
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      continue;
    }
    if (buffer.length() > 0) {
      buffer.append(separator);
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
  }
  return buffer.toString();
}
Program: 137381
Project: 137381
Buggy source:
@Override public String toString(){
  StringBuffer buf=new StringBuffer();
  buf.append(this.getClass().getSimpleName()).append("String_Node_Str");
  buf.append(this.recordSize).append("String_Node_Str");
  for (int i=0; i < usedIndices.length; i++) {
    buf.append(this.attributeMatchers[usedIndices[i]].getMatchType()).append("String_Node_Str");
  }
  return buf.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuffer buf=new StringBuffer();
  buf.append(this.getClass().getSimpleName()).append("String_Node_Str");
  buf.append(this.recordSize).append("String_Node_Str");
  for (  int usedIndice : usedIndices) {
    buf.append(this.attributeMatchers[usedIndice].getMatchType()).append("String_Node_Str");
  }
  return buf.toString();
}
Program: 137382
Project: 137382
Buggy source:
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      buffer=new StringBuffer(StringUtils.removeEnd(buffer.toString(),separator));
      continue;
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
    if (i != currentAttributeMatchingWeights.length - 1) {
      buffer.append(separator);
    }
  }
  return buffer.toString();
}

Fixed version (ground truth):
@Override public String getLabeledAttributeMatchWeights(){
  final String separator="String_Node_Str";
  StringBuffer buffer=new StringBuffer();
  double[] currentAttributeMatchingWeights=this.getCurrentAttributeMatchingWeights();
  for (int i=0; i < currentAttributeMatchingWeights.length; i++) {
    IAttributeMatcher attributeMatcher=this.attributeMatchers[i];
    if (attributeMatcher instanceof DummyMatcher) {
      continue;
    }
    if (displayLabels) {
      String attributeName=attributeMatcher.getAttributeName();
      if (attributeName != null) {
        if (buffer.length() > 0) {
          buffer.append(separator);
        }
        buffer.append(attributeName).append("String_Node_Str");
      }
    }
    buffer.append(currentAttributeMatchingWeights[i]);
  }
  return buffer.toString();
}
Program: 137383
Project: 137383
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.dbms.MySQLDbmsLanguage#regexLike(java.lang.String,java.lang.String)}.
 */
@Test public void testRegexLike(){
  String regexLike=mySQLDbmsLanguage.regexLike(REGEXP_1,REGEXP_2);
  Assert.assertNotNull(regexLike);
  Assert.assertEquals(regexLike,SPACE + REGEXP_1 + "String_Node_Str"+ REGEXP_2+ SPACE);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dq.dbms.MySQLDbmsLanguage#regexLike(java.lang.String,java.lang.String)}.
 */
@Test public void testRegexLike(){
  String regexLike=mySQLDbmsLanguage.regexLike(REGEXP_1,REGEXP_2);
  Assert.assertNotNull(regexLike);
  Assert.assertEquals(SPACE + REGEXP_1 + "String_Node_Str"+ REGEXP_2+ SPACE,regexLike);
}
Program: 137384
Project: 137384
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.dbms.MySQLDbmsLanguage#regexNotLike(java.lang.String,java.lang.String)}.
 */
@Test public void testRegexNotLike(){
  String regexLike=mySQLDbmsLanguage.regexNotLike(REGEXP_1,REGEXP_2);
  Assert.assertNotNull(regexLike);
  Assert.assertEquals(regexLike,SPACE + REGEXP_1 + "String_Node_Str"+ REGEXP_2+ SPACE);
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dq.dbms.MySQLDbmsLanguage#regexNotLike(java.lang.String,java.lang.String)}.
 */
@Test public void testRegexNotLike(){
  String regexLike=mySQLDbmsLanguage.regexNotLike(REGEXP_1,REGEXP_2);
  Assert.assertNotNull(regexLike);
  Assert.assertEquals(SPACE + REGEXP_1 + "String_Node_Str"+ REGEXP_2+ SPACE,regexLike);
}
Program: 137385
Project: 137385
Buggy source:
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals.
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}

Fixed version (ground truth):
/** 
 * when the drill down is : invalid, should find all rows which not start with 1~9,and 0. this include: null, and not digitals.
 * @return
 */
private String getInvalidClause(){
  String value="String_Node_Str";
  if (isSybase()) {
    return columnName + "String_Node_Str" + this.columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isPostGreSQL()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isTeradata()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isOracle()) {
    return columnName + "String_Node_Str" + "String_Node_Str"+ columnName+ "String_Node_Str";
  }
 else   if (isDB2()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ "String_Node_Str";
  }
 else   if (isSqlServer()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str"+ dbmsLanguage.like()+ "String_Node_Str";
  }
 else   if (isInformix()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
 else   if (isNetezza()) {
    return columnName + "String_Node_Str" + columnName+ "String_Node_Str";
  }
  return columnName + "String_Node_Str" + columnName+ value;
}
Program: 137386
Project: 137386
Buggy source:
@Override protected String getInstantiatedClause(){
  String function=getFunction();
  if (function != null && (DbmsLanguageFactory.isInfomix(this.dbmsLanguage.getDbmsName()) || DbmsLanguageFactory.isOracle(this.dbmsLanguage.getDbmsName()))) {
    function=columnName;
  }
  String clause=entity.isLabelNull() || function == null ? columnName + dbmsLanguage.isNull() : SOUNDEX_PREFIX + "String_Node_Str" + function+ "String_Node_Str"+ dbmsLanguage.equal()+ SOUNDEX_PREFIX+ "String_Node_Str"+ entity.getKey()+ "String_Node_Str";
  return clause;
}

Fixed version (ground truth):
@Override protected String getInstantiatedClause(){
  String function=getFunction();
  if (function != null && (DbmsLanguageFactory.isInfomix(this.dbmsLanguage.getDbmsName()) || DbmsLanguageFactory.isOracle(this.dbmsLanguage.getDbmsName()))) {
    function=columnName;
  }
  String clause=entity.isLabelNull() || function == null ? columnName + dbmsLanguage.isNull() : dbmsLanguage.getSoundexPrefix() + "String_Node_Str" + function+ "String_Node_Str"+ dbmsLanguage.equal()+ dbmsLanguage.getSoundexPrefix()+ "String_Node_Str"+ entity.getKey()+ "String_Node_Str";
  return clause;
}
Program: 137389
Project: 137389
Buggy source:
/** 
 * get the Valid Rows Statement.
 * @return
 */
public String getValidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexLike(columnName,regexPatternString) + functionReturnValue;
  return getRowsStatement(regexCmp);
}

Fixed version (ground truth):
/** 
 * get the Valid Rows Statement.
 * @return
 */
public String getValidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regularFunctionBodyWithReturnValue(columnName,regexPatternString);
  return getRowsStatement(regexCmp);
}
Program: 137390
Project: 137390
Buggy source:
/** 
 * get the Invalid Rows Statement.
 * @return
 */
public String getInvalidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.regexNotLike(columnName,regexPatternString) + functionReturnValue;
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getRowsStatement(pattCondStr);
}

Fixed version (ground truth):
/** 
 * get the Invalid Rows Statement.
 * @return
 */
public String getInvalidRowsStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidRowsExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=dbmsLanguage.notRegularFunctionBodyWithReturnValue(columnName,regexPatternString);
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getRowsStatement(pattCondStr);
}
Program: 137391
Project: 137391
Buggy source:
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  if (ColumnsetPackage.eINSTANCE.getAllMatchIndicator().isSuperTypeOf(indicator.eClass())) {
    return map;
  }
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  EList<Expression> instantiatedExpressions=this.indicator.getInstantiatedExpressions();
  if (instantiatedExpressions.size() > 0) {
    Expression expression=instantiatedExpressions.get(0);
    String body=expression.getBody().toUpperCase();
    String functionName=body.split("String_Node_Str").length > 1 ? body.split("String_Node_Str")[1] : "String_Node_Str";
    functionReturnValue=functionName.split("String_Node_Str").length > 1 ? functionName.split("String_Node_Str")[1] : "String_Node_Str";
    functionName=functionName.split("String_Node_Str").length > 1 ? functionName.split("String_Node_Str")[0] : "String_Node_Str";
    dbmsLanguage.setFunctionName(functionName);
    functionReturnValue=functionReturnValue.split("String_Node_Str").length > 1 ? functionReturnValue.split("String_Node_Str")[1] : "String_Node_Str";
    functionReturnValue=functionReturnValue.split("String_Node_Str").length > 1 ? functionReturnValue.split("String_Node_Str")[0] : "String_Node_Str";
  }
  map.put(MENU_VIEW_INVALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_INVALID_VALUES) + getInvalidValuesStatement() : null);
  map.put(MENU_VIEW_VALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_VALID_VALUES) + getValidValuesStatement() : null);
  map.put(MENU_VIEW_INVALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_INVALID_ROWS) + getInvalidRowsStatement() : null);
  map.put(MENU_VIEW_VALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_VALID_ROWS) + getValidRowsStatement() : null);
  return map;
}

Fixed version (ground truth):
public Map<String,String> getQueryMap(){
  Map<String,String> map=new HashMap<String,String>();
  if (ColumnsetPackage.eINSTANCE.getAllMatchIndicator().isSuperTypeOf(indicator.eClass())) {
    return map;
  }
  boolean isSqlEngine=ExecutionLanguage.SQL.equals(this.analysis.getParameters().getExecutionLanguage());
  EList<Expression> instantiatedExpressions=this.indicator.getInstantiatedExpressions();
  if (instantiatedExpressions.size() > 0) {
    Expression expression=instantiatedExpressions.get(0);
    String regularExpressionFunctionName=dbmsLanguage.extractRegularExpressionFunction(expression);
    dbmsLanguage.setRegularExpressionFunction(regularExpressionFunctionName);
  }
  map.put(MENU_VIEW_INVALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_INVALID_VALUES) + getInvalidValuesStatement() : null);
  map.put(MENU_VIEW_VALID_VALUES,isSqlEngine ? getComment(MENU_VIEW_VALID_VALUES) + getValidValuesStatement() : null);
  map.put(MENU_VIEW_INVALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_INVALID_ROWS) + getInvalidRowsStatement() : null);
  map.put(MENU_VIEW_VALID_ROWS,isSqlEngine ? getComment(MENU_VIEW_VALID_ROWS) + getValidRowsStatement() : null);
  return map;
}