nus-yam/ex-repair huggingface dataset:
Program: 136811
Project: 136811
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 sbui=new StringBuilder(i.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < integerParam; ++j) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - integerParam,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) {
      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: 136812
Project: 136812
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 sbui=new StringBuilder(l.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < integerParam; ++i) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - integerParam,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) {
      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: 136813
Project: 136813
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 repla=new StringBuilder(EMPTY_STRING);
      for (int i=sb.length() - integerParam; i < sb.length(); ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repla.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repla.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repla.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repla.append(str.charAt(i));
        }
      }
      sb.replace(str.length() - integerParam,str.length(),repla.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 repla=new StringBuilder(EMPTY_STRING);
      for (int i=sb.length() - parameter; i < sb.length(); ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repla.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repla.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repla.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repla.append(str.charAt(i));
        }
      }
      sb.replace(str.length() - parameter,str.length(),repla.toString());
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136814
Project: 136814
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: 136815
Project: 136815
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: 136816
Project: 136816
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: 136817
Project: 136817
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: 136818
Project: 136818
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void partClosed(IWorkbenchPart part){
  if (part instanceof org.eclipse.ui.internal.ViewIntroAdapterPart) {
    if (!PluginChecker.isOnlyTopLoaded()) {
      IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      if (activePage != null) {
        if (activePage.getPerspective().getId().equals(IBrandingConfiguration.PERSPECTIVE_DQ_ID)) {
          CheatSheetUtils.getInstance().findAndmaxDisplayCheatSheet();
        }
      }
    }
  }
  if (part.getClass().getName().equals(SqlExplorerUtils.SQLEDITOR_ID)) {
    unlockFile(part);
    super.partClosed(part);
    return;
  }
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
    WorkspaceResourceHelper.refreshItem(item);
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void partClosed(IWorkbenchPart part){
  if (maxCheatSheetHasSHow && part instanceof org.eclipse.ui.internal.cheatsheets.views.CheatSheetView) {
    IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    for (    IViewReference ref : activePage.getViewReferences()) {
      activePage.setPartState(ref,IWorkbenchPage.STATE_RESTORED);
    }
    maxCheatSheetHasSHow=false;
  }
  if (part.getClass().getName().equals(SqlExplorerUtils.SQLEDITOR_ID)) {
    unlockFile(part);
    super.partClosed(part);
    return;
  }
  if (!isCommonFormEditor(part)) {
    return;
  }
  Item item=getItem((IEditorPart)part);
  if (item == null) {
    return;
  }
  if (ProxyRepositoryManager.getInstance().isReadOnly() || ProxyRepositoryManager.getInstance().isEditable(item)) {
    ProxyRepositoryManager.getInstance().unLock(item);
    WorkspaceResourceHelper.refreshItem(item);
  }
 else {
    ProxyRepositoryManager.getInstance().refresh();
    CorePlugin.getDefault().refreshDQView();
  }
  super.partClosed(part);
}
Program: 136819
Project: 136819
Buggy source:
public void partDeactivated(IWorkbenchPart part){
  ContextViewHelper.resetContextView();
  if (part instanceof org.eclipse.ui.internal.ViewIntroAdapterPart) {
    if (PluginChecker.isOnlyTopLoaded()) {
      IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      if (activePage != null) {
        if (activePage.getPerspective().getId().equals(IBrandingConfiguration.PERSPECTIVE_DQ_ID)) {
          if (CheatSheetUtils.getInstance().isFirstTime()) {
            OpenCheatSheetAction action=new OpenCheatSheetAction("String_Node_Str");
            action.run();
          }
          IViewPart findView=activePage.findView(IIntroConstants.INTRO_VIEW_ID);
          if (findView != null) {
            activePage.hideView(findView);
          }
          CheatSheetUtils.getInstance().findAndmaxDisplayCheatSheet();
        }
      }
    }
  }
}

Fixed version (ground truth):
public void partDeactivated(IWorkbenchPart part){
  ContextViewHelper.resetContextView();
  if (part instanceof org.eclipse.ui.internal.ViewIntroAdapterPart) {
    if (CheatSheetUtils.getInstance().isFirstTime() && !PlatformUI.getWorkbench().isClosing()) {
      IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      if (activePage != null) {
        if (activePage.getPerspective().getId().equals(IBrandingConfiguration.PERSPECTIVE_DQ_ID)) {
          try {
            OpenCheatSheetAction action=new OpenCheatSheetAction(PluginConstant.GETTING_STARTED_CHEAT_SHEET_ID);
            action.run();
          }
 catch (          Exception e) {
            log.warn(e,e);
          }
          CheatSheetUtils.getInstance().findAndmaxDisplayCheatSheet();
          maxCheatSheetHasSHow=true;
        }
      }
    }
  }
}
Program: 136820
Project: 136820
Buggy source:
@Override public void run(IIntroSite site,Properties params){
  IPerspectiveDescriptor persDescription1=PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(CheatSheetUtils.DQ_PERSPECTIVE_ID);
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(persDescription1);
  String property=params.getProperty("String_Node_Str");
  if (CheatSheetUtils.getInstance().isFirstTime()) {
    OpenCheatSheetAction action=new OpenCheatSheetAction(property);
    action.run();
  }
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IViewPart findView=activePage.findView(IIntroConstants.INTRO_VIEW_ID);
  if (findView != null) {
    activePage.hideView(findView);
  }
  CheatSheetUtils.getInstance().findAndmaxDisplayCheatSheet();
}

Fixed version (ground truth):
@Override public void run(IIntroSite site,Properties params){
  IWorkbenchPage activePage=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
  IViewPart findView=activePage.findView(IIntroConstants.INTRO_VIEW_ID);
  if (findView != null) {
    activePage.hideView(findView);
  }
}
Program: 136821
Project: 136821
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: 136822
Project: 136822
Buggy source:
/** 
 * DOC talend Comment method "getIndicatorDefinition".
 * @param indicator
 * @return
 */
private TypedReturnCode<IndicatorDefinition> getIndicatorDefinition(Indicator indicator){
  TypedReturnCode<IndicatorDefinition> rt=new TypedReturnCode<IndicatorDefinition>(true);
  IndicatorDefinition indicatorDefinition;
  String label=indicator.getIndicatorDefinition().getLabel();
  if (label == null || PluginConstant.EMPTY_STRING.equals(label)) {
    indicatorDefinition=indicator.getIndicatorDefinition();
  }
 else {
    indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(label);
  }
  if (indicatorDefinition == null) {
    traceError(Messages.getString("String_Node_Str",indicator.getName()));
    rt.setOk(false);
  }
  rt.setObject(indicatorDefinition);
  return rt;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "getIndicatorDefinition".
 * @param indicator
 * @return
 */
private TypedReturnCode<IndicatorDefinition> getIndicatorDefinition(Indicator indicator){
  TypedReturnCode<IndicatorDefinition> rt=new TypedReturnCode<IndicatorDefinition>(true);
  IndicatorDefinition indicatorDefinition;
  String label=indicator.getIndicatorDefinition().getLabel();
  if (label == null || PluginConstant.EMPTY_STRING.equals(label)) {
    indicatorDefinition=indicator.getIndicatorDefinition();
  }
 else {
    indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(label);
  }
  if (indicatorDefinition == null) {
    indicatorDefinition=indicator.getIndicatorDefinition();
    if (indicatorDefinition.eIsProxy()) {
      indicatorDefinition=(IndicatorDefinition)EObjectHelper.resolveObject(indicatorDefinition);
    }
  }
  if (indicatorDefinition == null) {
    traceError(Messages.getString("String_Node_Str",indicator.getName()));
    rt.setOk(false);
  }
  rt.setObject(indicatorDefinition);
  return rt;
}
Program: 136825
Project: 136825
Buggy source:
/** 
 * DOC talend Comment method "getIndicatorDefinition".
 * @param indicator
 * @return
 */
private TypedReturnCode<IndicatorDefinition> getIndicatorDefinition(Indicator indicator){
  TypedReturnCode<IndicatorDefinition> rt=new TypedReturnCode<IndicatorDefinition>(true);
  IndicatorDefinition indicatorDefinition;
  String label=indicator.getIndicatorDefinition().getLabel();
  if (label == null || PluginConstant.EMPTY_STRING.equals(label)) {
    indicatorDefinition=indicator.getIndicatorDefinition();
  }
 else {
    indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(label);
  }
  if (indicatorDefinition == null) {
    traceError(Messages.getString("String_Node_Str",indicator.getName()));
    rt.setOk(false);
  }
  rt.setObject(indicatorDefinition);
  return rt;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "getIndicatorDefinition".
 * @param indicator
 * @return
 */
private TypedReturnCode<IndicatorDefinition> getIndicatorDefinition(Indicator indicator){
  TypedReturnCode<IndicatorDefinition> rt=new TypedReturnCode<IndicatorDefinition>(true);
  IndicatorDefinition indicatorDefinition;
  String label=indicator.getIndicatorDefinition().getLabel();
  if (label == null || PluginConstant.EMPTY_STRING.equals(label)) {
    indicatorDefinition=indicator.getIndicatorDefinition();
  }
 else {
    indicatorDefinition=DefinitionHandler.getInstance().getIndicatorDefinition(label);
  }
  if (indicatorDefinition == null) {
    indicatorDefinition=indicator.getIndicatorDefinition();
    if (indicatorDefinition.eIsProxy()) {
      indicatorDefinition=(IndicatorDefinition)EObjectHelper.resolveObject(indicatorDefinition);
    }
  }
  if (indicatorDefinition == null) {
    traceError(Messages.getString("String_Node_Str",indicator.getName()));
    rt.setOk(false);
  }
  rt.setObject(indicatorDefinition);
  return rt;
}
Program: 136826
Project: 136826
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: 136827
Project: 136827
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: 136828
Project: 136828
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: 136829
Project: 136829
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: 136830
Project: 136830
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;
    }
  }
}
Program: 136831
Project: 136831
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 sbui=new StringBuilder(i.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int j=0; j < integerParam; ++j) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - integerParam,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) {
      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: 136832
Project: 136832
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 sbui=new StringBuilder(l.toString());
      StringBuilder rempl=new StringBuilder(EMPTY_STRING);
      for (int i=0; i < integerParam; ++i) {
        rempl.append(rnd.nextInt(9));
      }
      sbui.replace(sbui.length() - integerParam,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) {
      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: 136833
Project: 136833
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 repla=new StringBuilder(EMPTY_STRING);
      for (int i=sb.length() - integerParam; i < sb.length(); ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repla.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repla.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repla.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repla.append(str.charAt(i));
        }
      }
      sb.replace(str.length() - integerParam,str.length(),repla.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 repla=new StringBuilder(EMPTY_STRING);
      for (int i=sb.length() - parameter; i < sb.length(); ++i) {
        if (Character.isDigit(str.charAt(i))) {
          repla.append(rnd.nextInt(9));
        }
 else         if (Character.isUpperCase(str.charAt(i))) {
          repla.append(UPPER.charAt(rnd.nextInt(26)));
        }
 else         if (Character.isLowerCase(str.charAt(i))) {
          repla.append(LOWER.charAt(rnd.nextInt(26)));
        }
 else {
          repla.append(str.charAt(i));
        }
      }
      sb.replace(str.length() - parameter,str.length(),repla.toString());
      return sb.toString();
    }
 else {
      return EMPTY_STRING;
    }
  }
}
Program: 136834
Project: 136834
Buggy source:
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME;
}

Fixed version (ground truth):
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME_WITH_VERSION;
}
Program: 136835
Project: 136835
Buggy source:
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> {"sqlexplorer-6.0.0.jar", "sqlexplorer.nl-6.0.0.jar"}
 */
protected abstract List<String> getJarFileWithVersionNames();

Fixed version (ground truth):
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> this file is on the local maven folder which is downloaded from the nexus server(with artifact-verion)<br/> {"sqlexplorer_6.0.0-{artifact-verion}.jar", "sqlexplorer.nl_6.0.0-{artifact-verion}.jar"}
 */
protected abstract List<String> getJarFileWithVersionNames();
Program: 136836
Project: 136836
Buggy source:
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> {"sqlexplorer.jar", "sqlexplorer.nl.jar"}
 */
protected abstract List<String> getJarFileNames();

Fixed version (ground truth):
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> this file is on the nexus server name.<br/> {"sqlexplorer_6.0.0.jar", "sqlexplorer.nl_6.0.0.jar"}
 */
protected abstract List<String> getJarFileNames();
Program: 136837
Project: 136837
Buggy source:
@Override public IStatus install(IProgressMonitor progress,List<URI> allRepoUris) throws Exception {
  IStatus installStatus=super.install(progress,allRepoUris);
  if (installStatus.isOK()) {
    try {
      moveJars();
    }
 catch (    MalformedURLException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
catch (    IOException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
  }
  return installStatus;
}

Fixed version (ground truth):
@Override public IStatus install(IProgressMonitor progress,List<URI> allRepoUris) throws Exception {
  IStatus installStatus=super.install(progress,allRepoUris);
  if (installStatus.isOK()) {
    try {
      copyJars2PluginsFolder();
    }
 catch (    MalformedURLException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
catch (    IOException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
  }
  return installStatus;
}
Program: 136839
Project: 136839
Buggy source:
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME;
}

Fixed version (ground truth):
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME_WITH_VERSION;
}
Program: 136840
Project: 136840
Buggy source:
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME;
}

Fixed version (ground truth):
@Override public String getJarFileName(){
  return ITOPChartService.JAR_FILE_NAME_WITH_VERSION;
}
Program: 136841
Project: 136841
Buggy source:
public static boolean isSupportedConnection(IRepositoryNode repNode){
  ERepositoryObjectType objectType=repNode.getObjectType();
  if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS) {
    ConnectionItem connectionItem=(ConnectionItem)repNode.getObject().getProperty().getItem();
    if (connectionItem.getConnection() instanceof DatabaseConnection) {
      String databaseType=((DatabaseConnection)connectionItem.getConnection()).getDatabaseType();
      List<String> tdqSupportDBType=MetadataConnectionUtils.getTDQSupportDBTemplate();
      return tdqSupportDBType.contains(databaseType);
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean isSupportedConnection(IRepositoryNode repNode){
  ERepositoryObjectType objectType=repNode.getObjectType();
  if (objectType == ERepositoryObjectType.METADATA_CONNECTIONS) {
    ConnectionItem connectionItem=null;
    try {
      connectionItem=(ConnectionItem)repNode.getObject().getProperty().getItem();
    }
 catch (    Exception e) {
      log.warn(e);
      return true;
    }
    if (connectionItem.getConnection() instanceof DatabaseConnection) {
      String databaseType=((DatabaseConnection)connectionItem.getConnection()).getDatabaseType();
      List<String> tdqSupportDBType=MetadataConnectionUtils.getTDQSupportDBTemplate();
      return tdqSupportDBType.contains(databaseType);
    }
  }
  return false;
}
Program: 136842
Project: 136842
Buggy source:
public void run(IAction action){
  ImportWizard wizard=new ImportWizard();
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(550,500);
  dialog.open();
}

Fixed version (ground truth):
public void run(IAction action){
  IWorkbenchPage activePage=CorePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
  boolean isSaved=activePage.closeAllEditors(true);
  if (!isSaved) {
    MessageUI.openWarning("String_Node_Str");
    return;
  }
  ImportWizard wizard=new ImportWizard();
  WizardDialog dialog=new WizardDialog(null,wizard);
  dialog.setPageSize(550,500);
  dialog.open();
}
Program: 136845
Project: 136845
Buggy source:
public void postFinish() throws IOException {
  for (  IPath path : this.allDeletedItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}

Fixed version (ground truth):
public void postFinish() throws IOException {
  for (  IPath path : this.allDeletedItems) {
    IFile desIFile=ResourceService.file2IFile(path.toFile());
    if (desIFile != null && desIFile.getFileExtension().equals(FactoriesUtil.PROPERTIES_EXTENSION)) {
      Property property=PropertyHelper.getProperty(desIFile,true);
      if (property != null) {
        try {
          ProxyRepositoryFactory.getInstance().save(property.getItem(),true);
        }
 catch (        PersistenceException e) {
          log.error(e);
        }
      }
    }
  }
  if (!need2MergeModelElementMap.isEmpty()) {
    for (    TDQItem item : need2MergeModelElementMap.keySet()) {
      ModelElement recordMe=need2MergeModelElementMap.get(item);
      mergeClientDependency2PatternOrUdi(item,recordMe);
    }
  }
  ItemRecord.clear();
  deleteTempProjectFolder();
}
Program: 136846
Project: 136846
Buggy source:
protected void initService(boolean isNeedDownload){
  BundleContext context=CWMPlugin.getDefault().getBundleContext();
  if (context == null) {
    return;
  }
  ServiceReference serviceReference=context.getServiceReference(getServiceName());
  if (serviceReference != null) {
    setService(context,serviceReference);
  }
 else   if (isNeedDownload) {
    String pathToStore=Platform.getInstallLocation().getURL().getFile() + "String_Node_Str";
    File movedfile=new File(pathToStore,getJarFileName());
    if (movedfile.exists()) {
      log.warn(Messages.getString(getRestartMessageName()));
    }
 else     if (!hasShowDownloadWizard) {
      IServiceLocator serviceLocator=PlatformUI.getWorkbench();
      ICommandService commandService=(ICommandService)serviceLocator.getService(ICommandService.class);
      try {
        Command command=commandService.getCommand(COMMAND_ID);
        command.executeWithChecks(new ExecutionEvent());
        hasShowDownloadWizard=true;
      }
 catch (      Exception e) {
        log.error(e);
      }
    }
 else {
      log.error(Messages.getString(getMissingMessageName()));
    }
  }
}

Fixed version (ground truth):
protected void initService(boolean isNeedDownload){
  BundleContext context=CWMPlugin.getDefault().getBundleContext();
  if (context == null) {
    return;
  }
  ServiceReference serviceReference=context.getServiceReference(getServiceName());
  if (serviceReference != null) {
    setService(context,serviceReference);
  }
 else   if (isNeedDownload) {
    if (!hasShowDownloadWizard) {
      IServiceLocator serviceLocator=PlatformUI.getWorkbench();
      ICommandService commandService=(ICommandService)serviceLocator.getService(ICommandService.class);
      try {
        Command command=commandService.getCommand(COMMAND_ID);
        command.executeWithChecks(new ExecutionEvent());
        hasShowDownloadWizard=true;
      }
 catch (      Exception e) {
        log.error(e);
      }
    }
 else {
      log.error(Messages.getString(getMissingMessageName()));
    }
  }
}
Program: 136847
Project: 136847
Buggy source:
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> {"sqlexplorer-6.0.0.jar", "sqlexplorer.nl-6.0.0.jar"}
 */
protected abstract List<String> getJarFileWithVersionNames();

Fixed version (ground truth):
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> this file is on the local maven folder which is downloaded from the nexus server(with artifact-verion)<br/> {"sqlexplorer_6.0.0-{artifact-verion}.jar", "sqlexplorer.nl_6.0.0-{artifact-verion}.jar"}
 */
protected abstract List<String> getJarFileWithVersionNames();
Program: 136848
Project: 136848
Buggy source:
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> {"sqlexplorer.jar", "sqlexplorer.nl.jar"}
 */
protected abstract List<String> getJarFileNames();

Fixed version (ground truth):
/** 
 * the jar file name must be in pairs and in order, jar file and jar nl file.<br/> this file is on the nexus server name.<br/> {"sqlexplorer_6.0.0.jar", "sqlexplorer.nl_6.0.0.jar"}
 */
protected abstract List<String> getJarFileNames();
Program: 136849
Project: 136849
Buggy source:
@Override public IStatus install(IProgressMonitor progress,List<URI> allRepoUris) throws Exception {
  IStatus installStatus=super.install(progress,allRepoUris);
  if (installStatus.isOK()) {
    try {
      moveJars();
    }
 catch (    MalformedURLException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
catch (    IOException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
  }
  return installStatus;
}

Fixed version (ground truth):
@Override public IStatus install(IProgressMonitor progress,List<URI> allRepoUris) throws Exception {
  IStatus installStatus=super.install(progress,allRepoUris);
  if (installStatus.isOK()) {
    try {
      copyJars2PluginsFolder(modulesForAutomaticInstall);
    }
 catch (    MalformedURLException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
catch (    IOException e) {
      MultiStatus multiStatus=new MultiStatus(CorePlugin.PLUGIN_ID,IStatus.ERROR,e.getMessage(),e);
      multiStatus.add(installStatus);
      return multiStatus;
    }
  }
  return installStatus;
}
Program: 136851
Project: 136851
Buggy source:
public DatabaseResultSet(ResultSet resultSet){
  this.rs=resultSet;
}

Fixed version (ground truth):
public DatabaseResultSet(ResultSet resultSet){
  setRs(resultSet);
}
Program: 136852
Project: 136852
Buggy source:
@Override protected void createTableContent(){
  try {
    TalendGridItem PreviewItem=new TalendGridItem(this,SWT.NONE);
    for (int i=0; i < this.getColumnCount(); i++) {
      PreviewItem.setCheckable(i,false);
    }
    PreviewItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    processNodePrivew(null,PreviewItem);
    PreviewItem.setExpanded(true);
  }
 catch (  SQLException e) {
  }
 finally {
    try {
      if (sqlConn != null) {
        sqlConn.close();
      }
    }
 catch (    SQLException e) {
    }
  }
}

Fixed version (ground truth):
@Override protected void createTableContent(){
  try {
    TalendGridItem PreviewItem=new TalendGridItem(this,SWT.NONE);
    for (int i=0; i < this.getColumnCount(); i++) {
      PreviewItem.setCheckable(i,false);
    }
    PreviewItem.setText(DefaultMessagesImpl.getString("String_Node_Str"));
    processNodePrivew(null,PreviewItem);
    PreviewItem.setExpanded(true);
  }
 catch (  SQLException e) {
  }
}
Program: 136853
Project: 136853
Buggy source:
/** 
 * DOC talend Comment method "getColumnValue".
 * @return
 * @throws SQLException
 */
protected String getColumnValue(int rowIndex,String sqlQuery,String columnName,IMetadataConnection metadataBean) throws SQLException {
  createStatement=initStatement(metadataBean);
  ResultSet rs=createStatement.executeQuery(sqlQuery);
  while (rs.absolute(rowIndex + 1)) {
    return rs.getObject(columnName).toString();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC talend Comment method "getColumnValue".
 * @param column
 * @param currentItem
 * @return
 * @throws SQLException
 */
private String getColumnValue(GridColumn column,GridItem currentItem) throws SQLException {
  DatabaseResultSet rs=(DatabaseResultSet)this.getData(COLUMN_RESULT_KEY);
  ModelElementIndicator modelElementIndicator=(ModelElementIndicator)column.getData();
  try {
    if (rs == null) {
      rs=(DatabaseResultSet)getResultSet(modelElementIndicator);
      this.setData(COLUMN_RESULT_KEY,rs);
    }
    int indexOfRow=this.indexOf(currentItem);
    if (rs.absolute(indexOfRow)) {
      String columnName=modelElementIndicator.getElementName();
      Object columnValue=rs.getObject(columnName);
      return columnValue == null ? PluginConstant.NULL_STRING : columnValue.toString();
    }
  }
  finally {
    if (rs != null) {
      Connection connection=rs.getRs().getStatement().getConnection();
      if (connection != null && !connection.isClosed()) {
        connection.close();
      }
    }
  }
  return null;
}
Program: 136854
Project: 136854
Buggy source:
/** 
 * Check whether the where clause is valid
 * @return true if the where clause is valid else return false
 */
public boolean checkWhereClause(){
  if (this.getColumnCount() <= 2) {
    return true;
  }
  GridColumn column=getColumn(2);
  ModelElementIndicator modelElementIndicator=(ModelElementIndicator)column.getData();
  try {
    getResultSet(modelElementIndicator);
  }
 catch (  SQLException e) {
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),e.getMessage());
    try {
      if (sqlConn != null) {
        sqlConn.close();
      }
    }
 catch (    SQLException e1) {
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Check whether the where clause is valid
 * @return true if the where clause is valid else return false
 */
public boolean checkWhereClause(){
  if (this.getColumnCount() <= 2) {
    return true;
  }
  GridColumn column=getColumn(2);
  ModelElementIndicator modelElementIndicator=(ModelElementIndicator)column.getData();
  DatabaseResultSet resultSet=null;
  try {
    resultSet=(DatabaseResultSet)getResultSet(modelElementIndicator);
  }
 catch (  SQLException e) {
    MessageDialog.openWarning(null,DefaultMessagesImpl.getString("String_Node_Str"),e.getMessage());
    return false;
  }
 finally {
    try {
      if (resultSet != null) {
        Connection connection=resultSet.getRs().getStatement().getConnection();
        if (connection != null && !connection.isClosed()) {
          connection.close();
        }
      }
    }
 catch (    SQLException e) {
      log.error(e,e);
      return false;
    }
  }
  return true;
}