nus-yam/ex-repair huggingface dataset:
Program: 136766
Project: 136766
Buggy source:
public void update(ObserverEvent observer){
switch (observer.getEventType()) {
case ItemHeaderWidth:
    Object width=observer.getData(ObserverEvent.ITEM_HEADER_WIDTH);
  if (width == null) {
    return;
  }
this.setItemHeaderWidth(Integer.parseInt(width.toString()));
break;
case HSrcollMove:
Object selection=observer.getData(ObserverEvent.HORIZONTAL_SCROLLBAR_MOVE);
if (selection == null) {
return;
}
this.getHorizontalBar().setSelection(Integer.parseInt(selection.toString()));
redraw(getClientArea().x,getClientArea().y,getClientArea().width,getClientArea().height,false);
break;
case VSrcollVisible:
Object show=observer.getData(ObserverEvent.VERTICAL_SRCOLL_VISABLE);
if (show == null || getVerticalBar() == null) {
return;
}
if (!getVerticalBar().isVisible() && Boolean.parseBoolean(show.toString())) {
GridData previewGridData=(GridData)this.getLayoutData();
previewGridData.widthHint=this.getBounds().width - 50 - getVerticalBar().getSize().x;
previewGridData.minimumWidth=this.getBounds().width - 50 - getVerticalBar().getSize().x;
previewGridData.horizontalAlignment=SWT.BEGINNING;
this.getParent().layout();
}
if (!getVerticalBar().isVisible() && !Boolean.parseBoolean(show.toString())) {
GridData previewGridData=(GridData)this.getLayoutData();
if (previewGridData.horizontalAlignment == SWT.FILL) {
return;
}
previewGridData.minimumWidth=650;
previewGridData.horizontalAlignment=SWT.FILL;
notifyVerticalBarShown(false);
this.getParent().layout();
}
break;
}
}

Fixed version (ground truth):
public void update(ObserverEvent observer){
switch (observer.getEventType()) {
case ItemHeaderWidth:
    Object width=observer.getData(ObserverEvent.ITEM_HEADER_WIDTH);
  if (width == null) {
    return;
  }
this.setItemHeaderWidth(Integer.parseInt(width.toString()));
break;
case HSrcollMove:
Object selection=observer.getData(ObserverEvent.HORIZONTAL_SCROLLBAR_MOVE);
if (selection == null) {
return;
}
this.getHorizontalBar().setSelection(Integer.parseInt(selection.toString()));
redraw(getClientArea().x,getClientArea().y,getClientArea().width,getClientArea().height,false);
break;
case VSrcollVisible:
Object show=observer.getData(ObserverEvent.VERTICAL_SRCOLL_VISABLE);
if (show == null || getVerticalBar() == null) {
return;
}
if (!getVerticalBar().isVisible() && Boolean.parseBoolean(show.toString())) {
GridData previewGridData=(GridData)this.getLayoutData();
previewGridData.widthHint=this.getBounds().width - 50 - getVerticalBar().getSize().x;
previewGridData.minimumWidth=this.getBounds().width - 50 - getVerticalBar().getSize().x;
previewGridData.horizontalAlignment=SWT.BEGINNING;
this.getParent().layout();
}
if (!getVerticalBar().isVisible() && !Boolean.parseBoolean(show.toString())) {
GridData previewGridData=(GridData)this.getLayoutData();
if (previewGridData.horizontalAlignment == SWT.FILL) {
return;
}
previewGridData.minimumWidth=650;
previewGridData.horizontalAlignment=SWT.FILL;
notifyVerticalBarShown(false);
this.getParent().layout();
}
break;
case ColumnHighlight:
Object data=observer.getData(ObserverEvent.COLUMN_HIGH_LIGHT);
handleColumnHighlight(((Integer)data));
break;
}
}
Program: 136767
Project: 136767
Buggy source:
/** 
 * DOC talend Comment method "processNodePrivew".
 * @param object
 * @param previewItem
 * @throws SQLException
 */
private void processNodePrivew(Object object,GridItem parentItem) throws SQLException {
  if (!checkSameTable()) {
    return;
  }
  try {
    for (int j=0; j < limitNumber; j++) {
      TalendGridItem currentItem=new TalendGridItem(parentItem,SWT.NONE);
      currentItem.setCheckable(0,false);
      currentItem.setCheckable(1,false);
      for (int i=2; i < this.getColumnCount(); i++) {
        GridColumn column=getColumn(i);
        currentItem.setCheckable(i,false);
        String columnValue=getColumnValue(column,currentItem);
        if (columnValue == null) {
          this.remove(this.indexOf(currentItem));
          return;
        }
        currentItem.setText(i,columnValue);
      }
    }
  }
  finally {
    ITalendResultSet rs=(ITalendResultSet)this.getData(COLUMN_RESULT_KEY);
    ModelElementIndicator modelElementIndicator=(ModelElementIndicator)getColumn(2).getData();
    closeConnection(rs,modelElementIndicator);
  }
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "processNodePrivew".
 * @param object
 * @param previewItem
 * @throws SQLException
 */
private void processNodePrivew(Object object,GridItem parentItem) throws SQLException {
  if (!checkSameTable()) {
    return;
  }
  try {
    for (int j=0; j < limitNumber; j++) {
      TalendGridItem currentItem=new TalendGridItem(parentItem,SWT.NONE);
      currentItem.setCheckable(0,false);
      currentItem.setCheckable(1,false);
      for (int i=2; i < this.getColumnCount(); i++) {
        GridColumn column=getColumn(i);
        currentItem.setCheckable(i,false);
        String columnValue=getColumnValue(column,currentItem);
        if (columnValue == null) {
          this.remove(this.indexOf(currentItem));
          return;
        }
        int minWith=columnValue.length() * 7 > 100 ? 100 : columnValue.length() * 7;
        column.setWidth(COLUMN_WIDTH < minWith ? minWith : COLUMN_WIDTH);
        currentItem.setText(i,columnValue);
      }
    }
  }
  finally {
    ITalendResultSet rs=(ITalendResultSet)this.getData(COLUMN_RESULT_KEY);
    ModelElementIndicator modelElementIndicator=(ModelElementIndicator)getColumn(2).getData();
    closeConnection(rs,modelElementIndicator);
  }
}
Program: 136768
Project: 136768
Buggy source:
/** 
 * ColumnPreviewGrid constructor comment.
 * @param dialog
 * @param parent
 * @param style
 * @param modelElementIndicators
 */
public ColumnPreviewGrid(IndicatorSelectDialog dialog,Composite parent,int style,ModelElementIndicator[] modelElementIndicators,int limit){
  super(dialog,parent,style,modelElementIndicators,limit);
}

Fixed version (ground truth):
/** 
 * ColumnPreviewGrid constructor comment.
 * @param dialog
 * @param parent
 * @param style
 * @param modelElementIndicators
 */
public ColumnPreviewGrid(IndicatorSelectDialog dialog,Composite parent,int style,ModelElementIndicator[] modelElementIndicators,int limit){
  super(dialog,parent,style,modelElementIndicators,limit);
  initializeGrid();
  addVscrollBarListener();
}
Program: 136771
Project: 136771
Buggy source:
/** 
 * DOC talend IndicatorSelectGrid constructor comment.
 * @param dialog
 * @param parent
 * @param style
 * @param modelElementIndicators
 */
public IndicatorSelectGrid(IndicatorSelectDialog dialog,Composite parent,int style,ModelElementIndicator[] modelElementIndicators){
  super(dialog,parent,style,modelElementIndicators);
}

Fixed version (ground truth):
/** 
 * DOC talend IndicatorSelectGrid constructor comment.
 * @param dialog
 * @param parent
 * @param style
 * @param modelElementIndicators
 */
public IndicatorSelectGrid(IndicatorSelectDialog dialog,Composite parent,int style,ModelElementIndicator[] modelElementIndicators,int[] preferColumnsWidth){
  super(dialog,parent,style,modelElementIndicators);
  this.preferColumnsWidth=preferColumnsWidth;
  initializeGrid();
  addVscrollBarListener();
}
Program: 136773
Project: 136773
Buggy source:
private void addKeys(String[] para){
  if (para.length > 0) {
    Scanner in;
    try {
      in=new Scanner(new FileReader(para[0]));
      while (in.hasNext()) {
        keys.add(in.next().trim());
      }
      in.close();
    }
 catch (    FileNotFoundException|NullPointerException e) {
      for (      String element : para) {
        keys.add(element);
      }
    }
  }
}

Fixed version (ground truth):
private void addKeys(String[] para){
  if (para.length > 0) {
    Scanner in;
    try {
      in=new Scanner(new FileReader(para[0]));
      while (in.hasNext()) {
        keys.add(in.next().trim());
      }
      in.close();
    }
 catch (    FileNotFoundException|NullPointerException e) {
      for (      String element : para) {
        keys.add(element.trim());
      }
    }
  }
}
Program: 136774
Project: 136774
Buggy source:
@Override public String generateMaskedRow(String str){
  if ((str == null) || EMPTY_STRING.equals(str) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str)) {
      addKeys(parameters);
      StringBuilder sb=new StringBuilder(str);
      int count=str.lastIndexOf('@');
      if (count == -1) {
        count=str.length();
      }
      if (keys.size() == 1 && keys.get(0).equals(EMPTY_STRING) || keys.size() == 0) {
        for (int i=0; i < count; ++i) {
          sb.setCharAt(i,'X');
        }
      }
 else {
        sb.replace(0,count,keys.get(rnd.nextInt(keys.size())));
      }
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}

Fixed version (ground truth):
@Override public String generateMaskedRow(String str){
  if ((str == null) || EMPTY_STRING.equals(str) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str)) {
      StringBuilder sb=new StringBuilder(str);
      int count=str.lastIndexOf('@');
      if (count == -1) {
        count=str.length();
      }
      if (keys.size() == 1 && keys.get(0).equals(EMPTY_STRING) || keys.size() == 0) {
        for (int i=0; i < count; ++i) {
          sb.setCharAt(i,'X');
        }
      }
 else {
        sb.replace(0,count,keys.get(rnd.nextInt(keys.size())));
      }
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136775
Project: 136775
Buggy source:
@Override public void postWindowOpen(){
  this.getWindowConfigurer().getWindow().getShell().setMaximized(true);
  super.postWindowOpen();
  ChangePerspectiveAction.getAction().switchTitle();
  ITDQRepositoryService tdqRepositoryService=(ITDQRepositoryService)org.talend.core.GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
  if (tdqRepositoryService != null) {
    tdqRepositoryService.addPartListener();
    tdqRepositoryService.addSoftwareSystemUpdateListener();
  }
}

Fixed version (ground truth):
@Override public void postWindowOpen(){
  this.getWindowConfigurer().getWindow().getShell().setMaximized(true);
  super.postWindowOpen();
  ChangePerspectiveAction.getAction().switchTitle();
  ITDQRepositoryService tdqRepositoryService=(ITDQRepositoryService)org.talend.core.GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
  if (tdqRepositoryService != null) {
    tdqRepositoryService.addPartListener();
    tdqRepositoryService.addSoftwareSystemUpdateListener();
  }
  IWorkbenchWindowConfigurer workbenchWindowConfigurer=getWindowConfigurer();
  PreferenceManager preferenceManager=workbenchWindowConfigurer.getWindow().getWorkbench().getPreferenceManager();
  preferenceManager.remove("String_Node_Str" + WorkbenchPlugin.PREFERENCE_PAGE_CATEGORY_SEPARATOR + "String_Node_Str");
  IActionBarConfigurer actionBarConfigurer=workbenchWindowConfigurer.getActionBarConfigurer();
  ICoolBarManager coolBarManager=actionBarConfigurer.getCoolBarManager();
  IContributionItem toolBarItem=coolBarManager.find("String_Node_Str");
  if (toolBarItem != null) {
    coolBarManager.remove(toolBarItem);
  }
  IMenuManager menuManager=actionBarConfigurer.getMenuManager();
  IContributionItem[] menuItems=menuManager.getItems();
  for (  IContributionItem menuItem : menuItems) {
    if ("String_Node_Str".equals(menuItem.getId()) || "String_Node_Str".equals(menuItem.getId())) {
      menuManager.remove(menuItem);
    }
  }
}
Program: 136776
Project: 136776
Buggy source:
/** 
 * Get query string with prefix (catalog/schema.table.column) given column array.
 * @param columns
 * @return
 */
public String getQueryColumnsWithPrefix(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  if (columns.length == 0) {
    return columnClause;
  }
  ColumnSet columnSet=ColumnHelper.getColumnOwnerAsColumnSet(columns[0]);
  String tableName=getQueryColumnSetWithPrefix(columnSet);
  for (  TdColumn column : columns) {
    columnClause+=tableName + DOT + quote(column.getName())+ PluginConstant.COMMA_STRING;
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}

Fixed version (ground truth):
/** 
 * Get query string with prefix (catalog/schema.table.column) given column array.
 * @param columns
 * @return
 */
public String getQueryColumnsWithPrefix(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  if (columns.length == 0) {
    return columnClause;
  }
  ColumnSet columnSet=ColumnHelper.getColumnOwnerAsColumnSet(columns[0]);
  String tableName=getQueryColumnSetWithPrefix(columnSet);
  for (  TdColumn column : columns) {
    columnClause+=tableName + DOT + quote(column.getName())+ getSeparatedCharacter();
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}
Program: 136777
Project: 136777
Buggy source:
protected String getQueryColumns(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  for (  TdColumn column : columns) {
    columnClause+=quote(column.getName()) + PluginConstant.COMMA_STRING;
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}

Fixed version (ground truth):
protected String getQueryColumns(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  for (  TdColumn column : columns) {
    columnClause+=quote(column.getName()) + getSeparatedCharacter();
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}
Program: 136778
Project: 136778
Buggy source:
protected String getRegexLike(String regexPatternString){
  return dbmsLanguage.regexLike(columnName,regexPatternString);
}

Fixed version (ground truth):
abstract protected String getRegexLike(String regexPatternString);
Program: 136779
Project: 136779
Buggy source:
protected String getRegexNotLike(String regexPatternString){
  return dbmsLanguage.regexNotLike(columnName,regexPatternString);
}

Fixed version (ground truth):
abstract protected String getRegexNotLike(String regexPatternString);
Program: 136780
Project: 136780
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=getRegexLike(regexPatternString) + dbmsLanguage.getFunctionReturnValue();
  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=getRegexLike(regexPatternString);
  return getRowsStatement(regexCmp);
}
Program: 136781
Project: 136781
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=getRegexNotLike(regexPatternString) + dbmsLanguage.getFunctionReturnValue();
  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=getRegexNotLike(regexPatternString);
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getRowsStatement(pattCondStr);
}
Program: 136782
Project: 136782
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(analysis.getParameters().getExecutionLanguage());
  EList<Expression> instantiatedExpressions=indicator.getInstantiatedExpressions();
  if (instantiatedExpressions.size() > 0) {
    Expression expression=instantiatedExpressions.get(0);
    String regexp=dbmsLanguage.getRegexPatternString(indicator);
    dbmsLanguage.setRegularExpressionFunction(dbmsLanguage.extractRegularExpressionFunction(expression,regexp));
    dbmsLanguage.setFunctionReturnValue(dbmsLanguage.extractRegularExpressionFunctionReturnValue(expression,regexp));
  }
  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(analysis.getParameters().getExecutionLanguage());
  initRegularExpressionParameter();
  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;
}
Program: 136783
Project: 136783
Buggy source:
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the valid Value of select column
 */
public String getValidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=getRegexLike(regexPatternString) + dbmsLanguage.getFunctionReturnValue();
  return getValuesStatement(columnName,regexCmp);
}

Fixed version (ground truth):
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the valid Value of select column
 */
public String getValidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewValidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=getRegexLike(regexPatternString);
  return getValuesStatement(columnName,regexCmp);
}
Program: 136784
Project: 136784
Buggy source:
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the invalid Value of select column
 */
public String getInvalidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=getRegexNotLike(regexPatternString) + dbmsLanguage.getFunctionReturnValue();
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getValuesStatement(columnName,pattCondStr);
}

Fixed version (ground truth):
/** 
 * get the Valid Values Statement.
 * @return SELECT statement for the invalid Value of select column
 */
public String getInvalidValuesStatement(){
  IndicatorDefinition indicatorDefinition=this.indicator.getIndicatorDefinition();
  if (indicatorDefinition instanceof UDIndicatorDefinition) {
    EList<TdExpression> list=((UDIndicatorDefinition)indicatorDefinition).getViewInvalidValuesExpression();
    return getQueryAfterReplaced(indicatorDefinition,list);
  }
  String regexPatternString=dbmsLanguage.getRegexPatternString(this.indicator);
  String regexCmp=getRegexNotLike(regexPatternString);
  String nullClause=dbmsLanguage.or() + columnName + dbmsLanguage.isNull();
  String pattCondStr="String_Node_Str" + regexCmp + nullClause+ "String_Node_Str";
  return getValuesStatement(columnName,pattCondStr);
}
Program: 136785
Project: 136785
Buggy source:
/** 
 * Extract the return value of regular Expression Function If current database type need to use UDF deal regular expression, the expresssion which will definition on "Regular Expression Matching.definition" should like below: "* + when REGULAR_FUNCTION(+ * +) + return value + then". else this method will not return correct result which you want
 * @param expression
 * @return the return value of regular Expression Function or empty string when the expression is invalid
 */
public String extractRegularExpressionFunctionReturnValue(Expression expression,String regexp){
  return PluginConstant.EMPTY_STRING;
}

Fixed version (ground truth):
/** 
 * Extract the return value of regular Expression Function If current database type need to use UDF deal regular expression, the expresssion which will definition on "Regular Expression Matching.definition" should like below: "* + when REGULAR_FUNCTION(+ * +) + return value + then". else this method will not return correct result which you want
 * @param expression
 * @return the return value of regular Expression Function or empty string when the expression is invalid
 */
public String extractRegularExpressionFunctionReturnValue(Expression expression,String regexp){
  String tempString=splictExpression(expression);
  if (regexp == null) {
    return tempString;
  }
  String splitKey=regexp.toUpperCase() + "String_Node_Str";
  int keyIndex=tempString.indexOf(splitKey) + splitKey.length();
  tempString=tempString.indexOf(splitKey) > -1 ? tempString.substring(keyIndex) : PluginConstant.EMPTY_STRING;
  tempString=tempString.split("String_Node_Str").length > 1 ? tempString.split("String_Node_Str")[0] : PluginConstant.EMPTY_STRING;
  return tempString.trim();
}
Program: 136786
Project: 136786
Buggy source:
/** 
 * Extract the name of regular Expression Function If current database type need to use UDF deal regular expression, the expresssion which will definition on "Regular Expression Matching.definition" should like below: "* + when REGULAR_FUNCTION(+ * +) + *". else this method will not return correct result which you want
 * @param expression
 * @return the name of regular Expression Function or empty string when the expression is invalid
 * @exception If current language is not implement this method will thorw UnsupportedOperationException
 */
public String extractRegularExpressionFunction(Expression expression,String regexp){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * Extract the name of regular Expression Function If current database type need to use UDF deal regular expression, the expresssion which will definition on "Regular Expression Matching.definition" should like below: "* + when REGULAR_FUNCTION(+ * +) + *". else this method will not return correct result which you want
 * @param expression
 * @return the name of regular Expression Function or empty string when the expression is invalid
 */
public String extractRegularExpressionFunction(Expression expression,String regexp){
  String functionName=null;
  try {
    String tempString=splictExpression(expression);
    functionName=tempString.split("String_Node_Str").length > 1 ? tempString.split("String_Node_Str")[0] : PluginConstant.EMPTY_STRING;
    functionName=functionName.trim();
  }
 catch (  NullPointerException e) {
    log.error(e,e);
  }
  return functionName;
}
Program: 136787
Project: 136787
Buggy source:
public static DataExplorer getDataExplorer(){
  return new PatternExplorer();
}

Fixed version (ground truth):
public static DataExplorer getDataExplorer(){
  return new RegexPatternExplorer();
}
Program: 136791
Project: 136791
Buggy source:
/** 
 * Test method for   {@link org.talend.dq.analysis.explore.PatternExplorer#PatternExplorer()}.
 */
@Test public void testPatternExplorer(){
  try {
    PatternExplorer pe=new PatternExplorer();
    Assert.assertNotNull(pe);
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Test method for   {@link org.talend.dq.analysis.explore.PatternExplorer#PatternExplorer()}.
 */
@Test public void testPatternExplorer(){
  try {
    RegexPatternExplorer pe=new RegexPatternExplorer();
    Assert.assertNotNull(pe);
  }
 catch (  Exception e) {
    fail(e.getMessage());
  }
}
Program: 136794
Project: 136794
Buggy source:
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#extractRegularExpressionFunction(Expression)}. case 7:Other database expression
 */
@Test public void testExtractRegularExpressionFunctionForOthers(){
  DbmsLanguage netezzaDbmsLanguage=DbmsLanguageFactory.createDbmsLanguage("String_Node_Str","String_Node_Str");
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  try {
    netezzaDbmsLanguage.extractRegularExpressionFunction(createExpression,"String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    return;
  }
  Assert.fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#extractRegularExpressionFunction(Expression)}. case 7:Other database expression
 */
@Test public void testExtractRegularExpressionFunctionForOthers(){
  DbmsLanguage netezzaDbmsLanguage=DbmsLanguageFactory.createDbmsLanguage("String_Node_Str","String_Node_Str");
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  try {
    netezzaDbmsLanguage.extractRegularExpressionFunction(createExpression,"String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    Assert.fail("String_Node_Str");
  }
}
Program: 136795
Project: 136795
Buggy source:
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#extractRegularExpressionFunction(Expression)}. case 6:Netezza database expression
 */
@Test public void testExtractRegularExpressionFunctionForNetezza(){
  DbmsLanguage netezzaDbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(SupportDBUrlType.NETEZZADEFAULTURL);
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  try {
    netezzaDbmsLanguage.extractRegularExpressionFunction(createExpression,"String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    return;
  }
  Assert.fail("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#extractRegularExpressionFunction(Expression)}. case 6:Netezza database expression
 */
@Test public void testExtractRegularExpressionFunctionForNetezza(){
  DbmsLanguage netezzaDbmsLanguage=DbmsLanguageFactory.createDbmsLanguage(SupportDBUrlType.NETEZZADEFAULTURL);
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  try {
    netezzaDbmsLanguage.extractRegularExpressionFunction(createExpression,"String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    Assert.fail("String_Node_Str");
  }
}
Program: 136796
Project: 136796
Buggy source:
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#setFunctionReturnValue(Expression)}. case 6: dbmsLanguage is sql
 */
@Test public void testSetFunctionReturnValueCase6(){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage("String_Node_Str","String_Node_Str");
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  dbmsLanguage.setFunctionReturnValue(dbmsLanguage.extractRegularExpressionFunctionReturnValue(createExpression,"String_Node_Str"));
  String regularfunctionReturnValue=dbmsLanguage.getFunctionReturnValue();
  Assert.assertEquals(PluginConstant.EMPTY_STRING,regularfunctionReturnValue);
}

Fixed version (ground truth):
/** 
 * {@link org.talend.dq.dbms.DbmsLanguage#setFunctionReturnValue(Expression)}. case 6: dbmsLanguage is sql
 */
@Test public void testSetFunctionReturnValueCase6(){
  DbmsLanguage dbmsLanguage=DbmsLanguageFactory.createDbmsLanguage("String_Node_Str","String_Node_Str");
  Expression createExpression=CoreFactory.eINSTANCE.createExpression();
  createExpression.setBody("String_Node_Str");
  dbmsLanguage.setFunctionReturnValue(dbmsLanguage.extractRegularExpressionFunctionReturnValue(createExpression,"String_Node_Str"));
  String regularfunctionReturnValue=dbmsLanguage.getFunctionReturnValue();
  Assert.assertEquals("String_Node_Str",regularfunctionReturnValue);
}
Program: 136798
Project: 136798
Buggy source:
/** 
 * Get query string with prefix (catalog/schema.table.column) given column array.
 * @param columns
 * @return
 */
public String getQueryColumnsWithPrefix(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  if (columns.length == 0) {
    return columnClause;
  }
  ColumnSet columnSet=ColumnHelper.getColumnOwnerAsColumnSet(columns[0]);
  String tableName=getQueryColumnSetWithPrefix(columnSet);
  for (  TdColumn column : columns) {
    columnClause+=tableName + DOT + quote(column.getName())+ PluginConstant.COMMA_STRING;
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}

Fixed version (ground truth):
/** 
 * Get query string with prefix (catalog/schema.table.column) given column array.
 * @param columns
 * @return
 */
public String getQueryColumnsWithPrefix(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  if (columns.length == 0) {
    return columnClause;
  }
  ColumnSet columnSet=ColumnHelper.getColumnOwnerAsColumnSet(columns[0]);
  String tableName=getQueryColumnSetWithPrefix(columnSet);
  for (  TdColumn column : columns) {
    columnClause+=tableName + DOT + quote(column.getName())+ getSeparatedCharacter();
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}
Program: 136799
Project: 136799
Buggy source:
protected String getQueryColumns(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  for (  TdColumn column : columns) {
    columnClause+=quote(column.getName()) + PluginConstant.COMMA_STRING;
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}

Fixed version (ground truth):
protected String getQueryColumns(TdColumn[] columns){
  String columnClause=PluginConstant.EMPTY_STRING;
  for (  TdColumn column : columns) {
    columnClause+=quote(column.getName()) + getSeparatedCharacter();
  }
  columnClause=columnClause.substring(0,columnClause.length() - 1);
  return columnClause;
}
Program: 136800
Project: 136800
Buggy source:
/** 
 * the modelelement can belong to current project or referenced project.
 * @param analysis
 * @return
 */
private static org.talend.core.model.general.Project getInWhichProject(ModelElement modelElement){
  if (modelElement instanceof DatabaseConnection) {
    if (modelElement.eIsProxy()) {
      modelElement=(ModelElement)EObjectHelper.resolveObject(modelElement);
    }
    String projectName=modelElement.eResource().getURI().segment(1);
    java.util.Set<Project> allProjects=ProxyRepositoryManager.getInstance().getAllProjects();
    for (    Project project : allProjects) {
      if (project.getTechnicalLabel().equals(projectName)) {
        return project;
      }
    }
  }
  Property property=PropertyHelper.getProperty(modelElement);
  org.talend.core.model.properties.Project project=ProjectManager.getInstance().getProject(property);
  return new org.talend.core.model.general.Project(project);
}

Fixed version (ground truth):
/** 
 * the modelelement can belong to current project or referenced project.
 * @param analysis
 * @return
 */
private static org.talend.core.model.general.Project getInWhichProject(ModelElement modelElement){
  if (modelElement instanceof DatabaseConnection || modelElement instanceof DelimitedFileConnection) {
    if (modelElement.eIsProxy()) {
      modelElement=(ModelElement)EObjectHelper.resolveObject(modelElement);
    }
    String projectName=modelElement.eResource().getURI().segment(1);
    java.util.Set<Project> allProjects=ProxyRepositoryManager.getInstance().getAllProjects();
    for (    Project project : allProjects) {
      if (project.getTechnicalLabel().equals(projectName)) {
        return project;
      }
    }
  }
  Property property=PropertyHelper.getProperty(modelElement);
  org.talend.core.model.properties.Project project=ProjectManager.getInstance().getProject(property);
  return new org.talend.core.model.general.Project(project);
}
Program: 136801
Project: 136801
Buggy source:
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      parameter=(int)Math.log10(i) + 1 <= integerParam ? (int)Math.log10(i) + 1 : integerParam;
      StringBuilder sbu=new StringBuilder(i.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < parameter; ++j) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,parameter,remp.toString());
      return Integer.parseInt(sbu.toString());
    }
 else {
      return 0;
    }
  }
}

Fixed version (ground truth):
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      if (i == 0) {
        return rnd.nextInt(9);
      }
 else {
        parameter=(int)Math.log10(i) + 1 <= integerParam ? (int)Math.log10(i) + 1 : integerParam;
        StringBuilder sbu=new StringBuilder(i.toString());
        StringBuilder remp=new StringBuilder(EMPTY_STRING);
        for (int j=0; j < parameter; ++j) {
          remp.append(rnd.nextInt(9));
        }
        sbu.replace(0,parameter,remp.toString());
        return Integer.parseInt(sbu.toString());
      }
    }
 else {
      return 0;
    }
  }
}
Program: 136802
Project: 136802
Buggy source:
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      parameter=(int)Math.log10(l) + 1 <= integerParam ? (int)Math.log10(l) + 1 : integerParam;
      StringBuilder sbu=new StringBuilder(l.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < parameter; ++i) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,parameter,remp.toString());
      return Long.parseLong(sbu.toString());
    }
 else {
      return 0L;
    }
  }
}

Fixed version (ground truth):
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      if (l == 0L) {
        return (long)rnd.nextInt(9);
      }
 else {
        parameter=(int)Math.log10(l) + 1 <= integerParam ? (int)Math.log10(l) + 1 : integerParam;
        StringBuilder sbu=new StringBuilder(l.toString());
        StringBuilder remp=new StringBuilder(EMPTY_STRING);
        for (int i=0; i < parameter; ++i) {
          remp.append(rnd.nextInt(9));
        }
        sbu.replace(0,parameter,remp.toString());
        return Long.parseLong(sbu.toString());
      }
    }
 else {
      return 0L;
    }
  }
}
Program: 136803
Project: 136803
Buggy source:
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      parameter=(int)Math.log10(i) + 1 <= integerParam ? (int)Math.log10(i) + 1 : integerParam;
      StringBuilder sbui=new StringBuilder(i.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < parameter; ++j) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - parameter,sbui.length(),rempl.toString());
      return Integer.parseInt(sbui.toString());
    }
 else {
      return 0;
    }
  }
}

Fixed version (ground truth):
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      if (i == 0) {
        return rnd.nextInt(9);
      }
 else {
        parameter=(int)Math.log10(i) + 1 <= integerParam ? (int)Math.log10(i) + 1 : integerParam;
        StringBuilder sbui=new StringBuilder(i.toString());
        StringBuilder rempl=new StringBuilder(EMPTY_STRING);
        for (int j=0; j < parameter; ++j) {
          rempl.append(rnd.nextInt(9));
        }
        sbui.replace(sbui.length() - parameter,sbui.length(),rempl.toString());
        return Integer.parseInt(sbui.toString());
      }
    }
 else {
      return 0;
    }
  }
}
Program: 136804
Project: 136804
Buggy source:
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      parameter=(int)Math.log10(l) + 1 <= integerParam ? (int)Math.log10(l) + 1 : integerParam;
      StringBuilder sbui=new StringBuilder(l.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < parameter; ++i) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - parameter,sbui.length(),rempl.toString());
      return Long.parseLong(sbui.toString());
    }
 else {
      return 0L;
    }
  }
}

Fixed version (ground truth):
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      if (l == 0L) {
        return (long)rnd.nextInt(9);
      }
 else {
        parameter=(int)Math.log10(l) + 1 <= integerParam ? (int)Math.log10(l) + 1 : integerParam;
        StringBuilder sbui=new StringBuilder(l.toString());
        StringBuilder rempl=new StringBuilder(EMPTY_STRING);
        for (int i=0; i < parameter; ++i) {
          rempl.append(rnd.nextInt(9));
        }
        sbui.replace(sbui.length() - parameter,sbui.length(),rempl.toString());
        return Long.parseLong(sbui.toString());
      }
    }
 else {
      return 0L;
    }
  }
}
Program: 136805
Project: 136805
Buggy source:
@Override public String generateMaskedRow(String str){
  StringBuilder sb=new StringBuilder(EMPTY_STRING);
  if ((str == null) || EMPTY_STRING.equals(str) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str)) {
      String[] address=str.split("String_Node_Str");
      for (      String tmp : address) {
        if (Arrays.asList(keys).contains(tmp)) {
          sb.append(tmp + "String_Node_Str");
        }
 else {
          for (int i=0; i < tmp.length(); ++i) {
            if (Character.isDigit(tmp.charAt(i))) {
              sb.append(Character.forDigit(rnd.nextInt(9),10));
            }
 else {
              sb.append("String_Node_Str");
            }
          }
          sb.append("String_Node_Str");
        }
      }
      return sb.deleteCharAt(sb.length() - 1).toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}

Fixed version (ground truth):
@Override public String generateMaskedRow(String str){
  StringBuilder sb=new StringBuilder(EMPTY_STRING);
  if ((str == null) || EMPTY_STRING.equals(str) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && !("String_Node_Str").equals(str)) {
      String[] address=str.split("String_Node_Str");
      for (      String tmp : address) {
        if (Arrays.asList(keys).contains(tmp)) {
          sb.append(tmp + "String_Node_Str");
        }
 else {
          for (int i=0; i < tmp.length(); ++i) {
            if (Character.isDigit(tmp.charAt(i))) {
              sb.append(Character.forDigit(rnd.nextInt(9),10));
            }
 else {
              sb.append("String_Node_Str");
            }
          }
          sb.append("String_Node_Str");
        }
      }
      return sb.deleteCharAt(sb.length() - 1).toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136806
Project: 136806
Buggy source:
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0) {
      if (integerParam > str.length()) {
        integerParam=str.length();
      }
      return str.substring(integerParam);
    }
 else {
      return EMPTY_STRING;
    }
  }
}

Fixed version (ground truth):
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0 && integerParam < str.length()) {
      return str.substring(integerParam);
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136807
Project: 136807
Buggy source:
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0) {
      if (integerParam > str.length()) {
        integerParam=str.length();
      }
      return str.substring(0,str.length() - integerParam);
    }
 else {
      return EMPTY_STRING;
    }
  }
}

Fixed version (ground truth):
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0 && integerParam < str.length()) {
      return str.substring(0,str.length() - integerParam);
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136808
Project: 136808
Buggy source:
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      if ((int)Math.log10(i) + 1 <= integerParam) {
        integerParam=(int)Math.log10(i) + 1;
      }
      StringBuilder sbu=new StringBuilder(i.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < integerParam; ++j) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,integerParam,remp.toString());
      return Integer.parseInt(sbu.toString());
    }
 else {
      return 0;
    }
  }
}

Fixed version (ground truth):
@Override public Integer generateMaskedRow(Integer i){
  if (i == null && keepNull) {
    return null;
  }
 else {
    if (i != null && integerParam > 0) {
      parameter=(int)Math.log10(i) + 1 <= integerParam ? (int)Math.log10(i) + 1 : integerParam;
      StringBuilder sbu=new StringBuilder(i.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < parameter; ++j) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,parameter,remp.toString());
      return Integer.parseInt(sbu.toString());
    }
 else {
      return 0;
    }
  }
}
Program: 136809
Project: 136809
Buggy source:
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      if ((int)Math.log10(l) + 1 < integerParam) {
        integerParam=(int)Math.log10(l) + 1;
      }
      StringBuilder sbu=new StringBuilder(l.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < integerParam; ++i) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,integerParam,remp.toString());
      return Long.parseLong(sbu.toString());
    }
 else {
      return 0L;
    }
  }
}

Fixed version (ground truth):
@Override public Long generateMaskedRow(Long l){
  if (l == null && keepNull) {
    return null;
  }
 else {
    if (l != null && integerParam > 0) {
      parameter=(int)Math.log10(l) + 1 <= integerParam ? (int)Math.log10(l) + 1 : integerParam;
      StringBuilder sbu=new StringBuilder(l.toString());
      StringBuilder remp=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < parameter; ++i) {
        remp.append(rnd.nextInt(9));
      }
      sbu.replace(0,parameter,remp.toString());
      return Long.parseLong(sbu.toString());
    }
 else {
      return 0L;
    }
  }
}
Program: 136810
Project: 136810
Buggy source:
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0) {
      if (integerParam > str.length()) {
        integerParam=str.length();
      }
      StringBuilder sb=new StringBuilder(str);
      StringBuilder repl=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < integerParam; ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repl.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repl.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repl.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repl.append(str.charAt(i));
        }
      }
      sb.replace(0,integerParam,repl.toString());
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}

Fixed version (ground truth):
@Override public String generateMaskedRow(String str){
  if ((str == null || EMPTY_STRING.equals(str)) && keepNull) {
    return str;
  }
 else {
    if (str != null && !EMPTY_STRING.equals(str) && integerParam > 0) {
      parameter=integerParam > str.length() ? str.length() : integerParam;
      StringBuilder sb=new StringBuilder(str);
      StringBuilder repl=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < parameter; ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repl.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repl.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repl.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repl.append(str.charAt(i));
        }
      }
      sb.replace(0,parameter,repl.toString());
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}