nus-yam/ex-repair huggingface dataset:
Program: 123760
Project: 123760
Buggy source:
@Override protected void okPressed(){
  IPreferenceStore preferenceStore=RepositoryManager.getPreferenceStore();
  String relust=convertToString(uncheckedNode,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NODE,relust.length() > 2 ? relust.substring(0,relust.length() - 2) : relust);
  String status=convertToString(uncheckedStatus,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_STATUS,status.length() > 2 ? status.substring(0,status.length() - 2) : status);
  String users=convertToString(uncheckedUser,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_USER,users.length() > 2 ? users.substring(0,users.length() - 2) : users);
  boolean canUserFilterEnable=this.userFilterPattern.getText() != null && !"String_Node_Str".equals(this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NAME,this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.TAG_USER_DEFINED_PATTERNS_ENABLED,this.enableUserPatternBtn.getSelection() && canUserFilterEnable);
  preferenceStore.setValue(IRepositoryPrefConstants.USER_FILTER_TABLE_ENABLED,!allUsersBtn.getSelection());
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  IPreferenceStore preferenceStore=RepositoryManager.getPreferenceStore();
  String relust=convertToString(uncheckedNode,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NODE,relust.length() > 2 ? relust.substring(0,relust.length() - 2) : relust);
  String status=convertToString(uncheckedStatus,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_STATUS,status.length() > 2 ? status.substring(0,status.length() - 2) : status);
  String users=convertToString(uncheckedUser,RepositoryManager.ITEM_SEPARATOR);
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_USER,users.length() > 2 ? users.substring(0,users.length() - 2) : users);
  boolean canUserFilterEnable=this.userFilterPattern.getText() != null && !"String_Node_Str".equals(this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.FILTER_BY_NAME,this.userFilterPattern.getText());
  preferenceStore.setValue(IRepositoryPrefConstants.TAG_USER_DEFINED_PATTERNS_ENABLED,this.enableUserPatternBtn.getSelection() && canUserFilterEnable);
  preferenceStore.setValue(IRepositoryPrefConstants.USER_FILTER_TABLE_ENABLED,!allUsersBtn.getSelection());
  repositoryView.refresh();
  super.okPressed();
}
Program: 123761
Project: 123761
Buggy source:
@Override protected void doRun(){
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    return;
  }
  final TreeViewer repositoryTreeView=CorePlugin.getDefault().getRepositoryService().getRepositoryTreeView();
  if (repositoryTreeView != null) {
    repositoryTreeView.getTree().setFocus();
  }
  ISelection selection=this.getSelection();
  if (toolbarAction == true) {
    IRepositoryView repositoryView=RepositoryView.show();
    selection=(IStructuredSelection)repositoryView.getViewer().getSelection();
  }
  if (selection instanceof IStructuredSelection) {
    RepositoryNode rNode=null;
    if (((IStructuredSelection)selection).getFirstElement() instanceof RepositoryNode) {
      rNode=(RepositoryNode)((IStructuredSelection)selection).getFirstElement();
    }
    ImportItemWizard wizard=new ImportItemWizard(rNode);
    IWorkbench workbench=this.getViewPart().getViewSite().getWorkbenchWindow().getWorkbench();
    wizard.setWindowTitle(IMPORT_ITEM);
    wizard.init(workbench,(IStructuredSelection)selection);
    Shell activeShell=Display.getCurrent().getActiveShell();
    WizardDialog dialog=new WizardDialog(activeShell,wizard);
    if (dialog.open() == Window.OK) {
      refresh();
      if (wizard.isNeedToRefreshPalette()) {
        ComponentUtilities.updatePalette();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    return;
  }
  final TreeViewer repositoryTreeView=CorePlugin.getDefault().getRepositoryService().getRepositoryTreeView();
  if (repositoryTreeView != null) {
    repositoryTreeView.getTree().setFocus();
  }
  ISelection selection=this.getSelection();
  if (toolbarAction == true) {
    IRepositoryView repositoryView=RepositoryView.show();
    selection=(IStructuredSelection)repositoryView.getViewer().getSelection();
  }
  if (selection instanceof IStructuredSelection) {
    RepositoryNode rNode=null;
    if (((IStructuredSelection)selection).getFirstElement() instanceof RepositoryNode) {
      rNode=(RepositoryNode)((IStructuredSelection)selection).getFirstElement();
    }
    ImportItemWizard wizard=new ImportItemWizard(null);
    IWorkbench workbench=this.getViewPart().getViewSite().getWorkbenchWindow().getWorkbench();
    wizard.setWindowTitle(IMPORT_ITEM);
    wizard.init(workbench,(IStructuredSelection)selection);
    Shell activeShell=Display.getCurrent().getActiveShell();
    WizardDialog dialog=new WizardDialog(activeShell,wizard);
    if (dialog.open() == Window.OK) {
      refresh();
      if (wizard.isNeedToRefreshPalette()) {
        ComponentUtilities.updatePalette();
      }
    }
  }
}
Program: 123762
Project: 123762
Buggy source:
@Override protected void doRun(){
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    return;
  }
  final TreeViewer repositoryTreeView=CorePlugin.getDefault().getRepositoryService().getRepositoryTreeView();
  if (repositoryTreeView != null) {
    repositoryTreeView.getTree().setFocus();
  }
  ISelection selection=this.getSelection();
  if (toolbarAction == true) {
    IRepositoryView repositoryView=RepositoryView.show();
    selection=(IStructuredSelection)repositoryView.getViewer().getSelection();
  }
  if (selection instanceof IStructuredSelection) {
    RepositoryNode rNode=null;
    if (((IStructuredSelection)selection).getFirstElement() instanceof RepositoryNode) {
      rNode=(RepositoryNode)((IStructuredSelection)selection).getFirstElement();
    }
    ImportItemWizard wizard=new ImportItemWizard(rNode);
    IWorkbench workbench=this.getViewPart().getViewSite().getWorkbenchWindow().getWorkbench();
    wizard.setWindowTitle(IMPORT_ITEM);
    wizard.init(workbench,(IStructuredSelection)selection);
    Shell activeShell=Display.getCurrent().getActiveShell();
    WizardDialog dialog=new WizardDialog(activeShell,wizard);
    if (dialog.open() == Window.OK) {
      refresh();
      if (wizard.isNeedToRefreshPalette()) {
        ComponentUtilities.updatePalette();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (ProxyRepositoryFactory.getInstance().isUserReadOnlyOnCurrentProject()) {
    return;
  }
  final TreeViewer repositoryTreeView=CorePlugin.getDefault().getRepositoryService().getRepositoryTreeView();
  if (repositoryTreeView != null) {
    repositoryTreeView.getTree().setFocus();
  }
  ISelection selection=this.getSelection();
  if (toolbarAction == true) {
    IRepositoryView repositoryView=RepositoryView.show();
    selection=(IStructuredSelection)repositoryView.getViewer().getSelection();
  }
  if (selection instanceof IStructuredSelection) {
    RepositoryNode rNode=null;
    if (((IStructuredSelection)selection).getFirstElement() instanceof RepositoryNode) {
      rNode=(RepositoryNode)((IStructuredSelection)selection).getFirstElement();
    }
    ImportItemWizard wizard=new ImportItemWizard(null);
    IWorkbench workbench=this.getViewPart().getViewSite().getWorkbenchWindow().getWorkbench();
    wizard.setWindowTitle(IMPORT_ITEM);
    wizard.init(workbench,(IStructuredSelection)selection);
    Shell activeShell=Display.getCurrent().getActiveShell();
    WizardDialog dialog=new WizardDialog(activeShell,wizard);
    if (dialog.open() == Window.OK) {
      refresh();
      if (wizard.isNeedToRefreshPalette()) {
        ComponentUtilities.updatePalette();
      }
    }
  }
}
Program: 123772
Project: 123772
Buggy source:
private void recompilePatternIfNecessary(String regexpPattern){
  if (pattern == null || !regexpPattern.equals(pattern.getPattern())) {
    try {
      System.out.println(regexpPattern);
      pattern=compiler.compile(regexpPattern);
    }
 catch (    MalformedPatternException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
private void recompilePatternIfNecessary(String regexpPattern){
  if (pattern == null || !regexpPattern.equals(pattern.getPattern())) {
    try {
      pattern=compiler.compile(regexpPattern);
    }
 catch (    MalformedPatternException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 123781
Project: 123781
Buggy source:
private void createToolbar(){
  TreeToolBarLayout manager=new TreeToolBarLayout();
  manager.setVertical(false);
  manager.setSpacing(5);
  this.setLayoutManager(manager);
  boolean isInputMain=false;
  if (abstractTree instanceof InputXmlTree) {
    isInputMain=!((InputXmlTree)abstractTree).isLookup();
  }
  if (!isInputMain) {
    setLoopFunctionButton=new SetLoopFunctionButton(ImageProviderMapper.getImage(ImageInfo.SETLOOPFUNCTION_BUTTON));
    this.add(setLoopFunctionButton);
    condensedButton=new CondensedButton(ImageProviderMapper.getImage(ImageInfo.CONDENSED_TOOL_ICON));
    condensedButton.setSelected(abstractTree.isActivateCondensedTool());
    this.add(condensedButton);
    expressionFilterButton=new ExpressionFilterButton(ImageProviderMapper.getImage(ImageInfo.ACTIVATE_FILTER_ICON));
    expressionFilterButton.setSelected(abstractTree.isActivateExpressionFilter());
    this.add(expressionFilterButton);
    boolean isErrorReject=false;
    if (abstractTree instanceof OutputXmlTree) {
      isErrorReject=((OutputXmlTree)abstractTree).isErrorReject();
    }
    if (isErrorReject) {
      condensedButton.setEnabled(false);
      expressionFilterButton.setEnabled(false);
    }
  }
  Image image=null;
  if (abstractTree.isMinimized()) {
    image=restorImage;
  }
 else {
    image=miniImage;
  }
  min_size=new MinSizeButton(image);
  this.add(min_size);
  setTooltips();
}

Fixed version (ground truth):
private void createToolbar(){
  TreeToolBarLayout manager=new TreeToolBarLayout();
  manager.setVertical(false);
  manager.setSpacing(5);
  this.setLayoutManager(manager);
  boolean isInputMain=false;
  boolean isLookup=false;
  if (abstractTree instanceof InputXmlTree) {
    isInputMain=!((InputXmlTree)abstractTree).isLookup();
    isLookup=((InputXmlTree)abstractTree).isLookup();
  }
  if (!isInputMain) {
    if (!isLookup) {
      setLoopFunctionButton=new SetLoopFunctionButton(ImageProviderMapper.getImage(ImageInfo.SETLOOPFUNCTION_BUTTON));
      this.add(setLoopFunctionButton);
    }
    condensedButton=new CondensedButton(ImageProviderMapper.getImage(ImageInfo.CONDENSED_TOOL_ICON));
    condensedButton.setSelected(abstractTree.isActivateCondensedTool());
    this.add(condensedButton);
    expressionFilterButton=new ExpressionFilterButton(ImageProviderMapper.getImage(ImageInfo.ACTIVATE_FILTER_ICON));
    expressionFilterButton.setSelected(abstractTree.isActivateExpressionFilter());
    this.add(expressionFilterButton);
    boolean isErrorReject=false;
    if (abstractTree instanceof OutputXmlTree) {
      isErrorReject=((OutputXmlTree)abstractTree).isErrorReject();
    }
    if (isErrorReject) {
      condensedButton.setEnabled(false);
      expressionFilterButton.setEnabled(false);
    }
  }
  Image image=null;
  if (abstractTree.isMinimized()) {
    image=restorImage;
  }
 else {
    image=miniImage;
  }
  min_size=new MinSizeButton(image);
  this.add(min_size);
  setTooltips();
}
Program: 123782
Project: 123782
Buggy source:
public static OutputTreeNodeEditPart getParentLoopNodeEditPart(OutputTreeNodeEditPart nodePart){
  if (nodePart != null && nodePart instanceof OutputTreeNodeEditPart) {
    OutputTreeNodeEditPart nodePartTemp=(OutputTreeNodeEditPart)nodePart;
    TreeNode model=(TreeNode)nodePartTemp.getModel();
    if (model.isLoop()) {
      return nodePartTemp;
    }
 else {
      if (nodePartTemp.getParent() != null && nodePartTemp.getParent() instanceof OutputTreeNodeEditPart) {
        getParentLoopNodeEditPart((OutputTreeNodeEditPart)nodePartTemp.getParent());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static OutputTreeNodeEditPart getParentLoopNodeEditPart(OutputTreeNodeEditPart nodePart){
  if (nodePart != null && nodePart instanceof OutputTreeNodeEditPart) {
    OutputTreeNodeEditPart nodePartTemp=(OutputTreeNodeEditPart)nodePart;
    TreeNode model=(TreeNode)nodePartTemp.getModel();
    if (model.isLoop()) {
      return nodePartTemp;
    }
 else {
      if (nodePartTemp.getParent() != null && nodePartTemp.getParent() instanceof OutputTreeNodeEditPart) {
        return getParentLoopNodeEditPart((OutputTreeNodeEditPart)nodePartTemp.getParent());
      }
    }
  }
  return null;
}
Program: 123795
Project: 123795
Buggy source:
/** 
 * DOC JKWANG Comment method "isOracleAmazonStringContained".
 * @param string
 * @return
 */
private static boolean isOracleAmazonStringContained(String dbType,String emfName){
  if (dbType != null && !dbType.equals(EDatabaseTypeName.ORACLEFORSID.getDisplayName()) && emfName != null && Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE).matcher(dbType).matches()) {
    for (    String amazonString : ORACLE_AMAZON_STRING) {
      if (emfName.equals(amazonString)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * DOC JKWANG Comment method "isOracleAmazonStringContained".
 * @param string
 * @return
 */
private static boolean isOracleAmazonStringContained(Node node,String dbType,String emfName){
  if (emfName != null && Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE).matcher(dbType).matches()) {
    for (    String amazonString : ORACLE_AMAZON_STRING) {
      if (emfName.equals(amazonString)) {
        IElementParameter param=node.getElementParameter("String_Node_Str");
        if (param != null) {
          Object[] valuesList=param.getListItemsValue();
          for (int i=0; i < valuesList.length; i++) {
            String type=EDatabaseTypeName.getTypeFromDbType(valuesList[i].toString()).getDisplayName();
            if (type != null && type.equals(dbType)) {
              return false;
            }
          }
        }
        return true;
      }
    }
  }
  return false;
}
Program: 123800
Project: 123800
Buggy source:
protected void restoreWidgetValuesForPetalsESB(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    String saName=getPetalsDefaultSaName();
    if (directoryNames != null && directoryNames.length > 0) {
      for (int i=0; i < directoryNames.length; i++) {
        saDestinationFilePath=new Path(directoryNames[i]).append(saName).toOSString();
        addDestinationItem(saDestinationFilePath);
        setDestinationValue(saDestinationFilePath);
      }
    }
 else {
      String userDir=System.getProperty("String_Node_Str");
      IPath path=new Path(userDir).append(saName);
      saDestinationFilePath=path.toOSString();
      setDestinationValue(saDestinationFilePath);
    }
    sourceButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
    userRoutineButton.setSelection(settings.getBoolean(STORE_USER_ROUTINE_ID));
    zipOption="String_Node_Str";
  }
  if (getProcessItem() != null) {
    List<String> contextNames=getJobContexts(getProcessItem());
    contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
    contextCombo.setVisibleItemCount(contextNames.size());
    if (contextNames.size() > 0)     contextCombo.select(0);
  }
}

Fixed version (ground truth):
protected void restoreWidgetValuesForPetalsESB(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    String saName=getPetalsDefaultSaName();
    if (directoryNames != null && directoryNames.length > 0) {
      for (int i=0; i < directoryNames.length; i++) {
        if (directoryNames[i].toLowerCase().endsWith("String_Node_Str")) {
          directoryNames[i]=(directoryNames[i].charAt(0) + "String_Node_Str").toUpperCase() + directoryNames[i].substring(1);
          addDestinationItem(directoryNames[i]);
        }
        setDestinationValue(directoryNames[0].substring(0,(directoryNames[0].lastIndexOf("String_Node_Str") + 1)) + saName);
      }
    }
 else {
      String userDir=System.getProperty("String_Node_Str");
      IPath path=new Path(userDir).append(saName);
      saDestinationFilePath=path.toOSString();
      setDestinationValue(saDestinationFilePath);
    }
    sourceButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
    userRoutineButton.setSelection(settings.getBoolean(STORE_USER_ROUTINE_ID));
    zipOption="String_Node_Str";
  }
  if (getProcessItem() != null) {
    List<String> contextNames=getJobContexts(getProcessItem());
    contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
    contextCombo.setVisibleItemCount(contextNames.size());
    if (contextNames.size() > 0)     contextCombo.select(0);
  }
}
Program: 123802
Project: 123802
Buggy source:
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=getDefaultFileNameWithType();
      for (int i=0; i < directoryNames.length; i++) {
        String destination=new Path(directoryNames[i]).append(fileName).toOSString();
        addDestinationItem(destination);
        setDestinationValue(destination);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}

Fixed version (ground truth):
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=getDefaultFileNameWithType();
      for (int i=0; i < directoryNames.length; i++) {
        if (directoryNames[i].toLowerCase().endsWith("String_Node_Str")) {
          directoryNames[i]=(directoryNames[i].charAt(0) + "String_Node_Str").toUpperCase() + directoryNames[i].substring(1);
          addDestinationItem(directoryNames[i]);
        }
        setDestinationValue(directoryNames[0].substring(0,(directoryNames[0].lastIndexOf("String_Node_Str") + 1)) + fileName);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}
Program: 123805
Project: 123805
Buggy source:
protected void restoreWidgetValuesForPetalsESB(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    String saName=getPetalsDefaultSaName();
    if (directoryNames != null && directoryNames.length > 0) {
      for (int i=0; i < directoryNames.length; i++) {
        saDestinationFilePath=new Path(directoryNames[i]).append(saName).toOSString();
        addDestinationItem(saDestinationFilePath);
        setDestinationValue(saDestinationFilePath);
      }
    }
 else {
      String userDir=System.getProperty("String_Node_Str");
      IPath path=new Path(userDir).append(saName);
      saDestinationFilePath=path.toOSString();
      setDestinationValue(saDestinationFilePath);
    }
    sourceButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
    userRoutineButton.setSelection(settings.getBoolean(STORE_USER_ROUTINE_ID));
    zipOption="String_Node_Str";
  }
  if (getProcessItem() != null) {
    List<String> contextNames=getJobContexts(getProcessItem());
    contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
    contextCombo.setVisibleItemCount(contextNames.size());
    if (contextNames.size() > 0)     contextCombo.select(0);
  }
}

Fixed version (ground truth):
protected void restoreWidgetValuesForPetalsESB(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    String saName=getPetalsDefaultSaName();
    if (directoryNames != null && directoryNames.length > 0) {
      for (int i=0; i < directoryNames.length; i++) {
        if (directoryNames[i].toLowerCase().endsWith("String_Node_Str")) {
          directoryNames[i]=(directoryNames[i].charAt(0) + "String_Node_Str").toUpperCase() + directoryNames[i].substring(1);
          addDestinationItem(directoryNames[i]);
        }
        setDestinationValue(directoryNames[0].substring(0,(directoryNames[0].lastIndexOf("String_Node_Str") + 1)) + saName);
      }
    }
 else {
      String userDir=System.getProperty("String_Node_Str");
      IPath path=new Path(userDir).append(saName);
      saDestinationFilePath=path.toOSString();
      setDestinationValue(saDestinationFilePath);
    }
    sourceButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
    userRoutineButton.setSelection(settings.getBoolean(STORE_USER_ROUTINE_ID));
    zipOption="String_Node_Str";
  }
  if (getProcessItem() != null) {
    List<String> contextNames=getJobContexts(getProcessItem());
    contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
    contextCombo.setVisibleItemCount(contextNames.size());
    if (contextNames.size() > 0)     contextCombo.select(0);
  }
}
Program: 123807
Project: 123807
Buggy source:
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=getDefaultFileNameWithType();
      for (int i=0; i < directoryNames.length; i++) {
        String destination=new Path(directoryNames[i]).append(fileName).toOSString();
        addDestinationItem(destination);
        setDestinationValue(destination);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}

Fixed version (ground truth):
protected void restoreWidgetValuesForOSGI(){
  IDialogSettings settings=getDialogSettings();
  if (settings != null) {
    String[] directoryNames=settings.getArray(STORE_DESTINATION_NAMES_ID);
    if (directoryNames != null && directoryNames.length > 0) {
      String fileName=getDefaultFileNameWithType();
      for (int i=0; i < directoryNames.length; i++) {
        if (directoryNames[i].toLowerCase().endsWith("String_Node_Str")) {
          directoryNames[i]=(directoryNames[i].charAt(0) + "String_Node_Str").toUpperCase() + directoryNames[i].substring(1);
          addDestinationItem(directoryNames[i]);
        }
        setDestinationValue(directoryNames[0].substring(0,(directoryNames[0].lastIndexOf("String_Node_Str") + 1)) + fileName);
      }
    }
 else {
      setDefaultDestinationForOSGI();
    }
  }
 else {
    setDefaultDestinationForOSGI();
  }
}
Program: 123811
Project: 123811
Buggy source:
private void checkInitialSelections(){
  for (  UpdateResult result : getInputElements()) {
    result.setChecked(true);
    if (result.isReadOnlyProcess()) {
      result.setChecked(false);
      this.isJobReadOnly=true;
    }
switch (result.getResultType()) {
case RENAME:
case RELOAD:
case JOBLET_UPDATE:
      this.canCancel=false;
    return;
default :
  this.canCancel=true;
}
}
}

Fixed version (ground truth):
private void checkInitialSelections(){
  for (  UpdateResult result : getInputElements()) {
    result.setChecked(true);
    if (result.isReadOnlyProcess()) {
      result.setChecked(false);
      this.isJobReadOnly=true;
    }
switch (result.getResultType()) {
case RENAME:
case RELOAD:
case JOBLET_UPDATE:
      this.canCancel=false;
    this.canDeselect=false;
  return;
default :
this.canCancel=true;
this.canDeselect=true;
}
}
}
Program: 123813
Project: 123813
Buggy source:
private boolean isMappedChild(String tempXpath){
  for (  Object obj : schemaTargets) {
    String relativeXPathQuery="String_Node_Str";
    if (obj instanceof SchemaTarget) {
      relativeXPathQuery=((SchemaTarget)obj).getRelativeXPathQuery();
    }
 else     if (obj instanceof ConceptTarget) {
      relativeXPathQuery=((ConceptTarget)obj).getRelativeLoopExpression();
    }
    final String toAbsolute=absoluteXPathQuery + XmlMapUtil.XPATH_SEPARATOR + relativeXPathQuery;
    if (toAbsolute.startsWith(tempXpath)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isMappedChild(String tempXpath){
  if (targetAbsolutePath == null) {
    targetAbsolutePath=new ArrayList<String>();
    targetAbsolutePath.add(absoluteXPathQuery);
    Pattern regex=Pattern.compile(RELATIVE_PATH_PATTERN,Pattern.CANON_EQ | Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
    for (    Object obj : schemaTargets) {
      String relativeXPathQuery="String_Node_Str";
      if (obj instanceof SchemaTarget) {
        relativeXPathQuery=((SchemaTarget)obj).getRelativeXPathQuery();
      }
 else       if (obj instanceof ConceptTarget) {
        relativeXPathQuery=((ConceptTarget)obj).getRelativeLoopExpression();
      }
      StringBuffer tempAbsolute=new StringBuffer();
      tempAbsolute.append(absoluteXPathQuery);
      tempAbsolute.append(XmlMapUtil.XPATH_SEPARATOR);
      tempAbsolute.append(relativeXPathQuery);
      if (relativeXPathQuery.startsWith(RELATIVE_PATH)) {
        Matcher regexMatcher=regex.matcher(relativeXPathQuery);
        int relativeLength=0;
        while (regexMatcher.find()) {
          relativeLength++;
        }
        if (relativeLength > 0) {
          String subRelativeQuery=relativeXPathQuery.substring(relativeLength * RELATIVE_PATH.length(),relativeXPathQuery.length());
          String[] absoluteSplit=absoluteXPathQuery.split(XmlMapUtil.XPATH_SEPARATOR);
          if (absoluteSplit.length > relativeLength) {
            tempAbsolute=new StringBuffer();
            for (int i=0; i < absoluteSplit.length - relativeLength; i++) {
              tempAbsolute.append(absoluteSplit[i]);
              tempAbsolute.append(XmlMapUtil.XPATH_SEPARATOR);
            }
            tempAbsolute.append(subRelativeQuery);
          }
        }
      }
      targetAbsolutePath.add(tempAbsolute.toString());
    }
  }
  for (  String absTarget : targetAbsolutePath) {
    if (absTarget.startsWith(tempXpath)) {
      return true;
    }
  }
  return false;
}
Program: 123819
Project: 123819
Buggy source:
private boolean filterRepositoryNode(Object element){
  if (!(element instanceof RepositoryNode)) {
    return false;
  }
  RepositoryNode node=(RepositoryNode)element;
  if (node.isBin()) {
    return false;
  }
  ENodeType nodeType=node.getType();
  boolean visible=false;
  if (nodeType != null) {
switch (nodeType) {
case SYSTEM_FOLDER:
      if (!ERepositoryObjectType.ROUTINES.equals(node.getContentType())) {
        visible=true;
      }
    break;
case STABLE_SYSTEM_FOLDER:
  if (node.getParent() != null && node.getParent().getObjectType() == null && !ERepositoryObjectType.DOCUMENTATION.equals(node.getParent().getContentType())) {
    visible=true;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.SQLPATTERNS.equals(node.getParent().getContentType()) && node.getParent().getObjectType() == null) {
visible=true;
}
break;
case REFERENCED_PROJECT:
visible=true;
break;
default :
visible=false;
break;
}
}
return visible;
}

Fixed version (ground truth):
private boolean filterRepositoryNode(Object element){
  if (!(element instanceof RepositoryNode)) {
    return false;
  }
  RepositoryNode node=(RepositoryNode)element;
  if (node.isBin()) {
    return false;
  }
  ENodeType nodeType=node.getType();
  boolean visible=false;
  if (nodeType != null) {
switch (nodeType) {
case SYSTEM_FOLDER:
      visible=true;
    break;
case STABLE_SYSTEM_FOLDER:
  if (node.getParent() != null && node.getParent().getObjectType() == null && !ERepositoryObjectType.DOCUMENTATION.equals(node.getParent().getContentType()) && !ERepositoryObjectType.ROUTINES.equals(node.getParent().getContentType())) {
    visible=true;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.SQLPATTERNS.equals(node.getParent().getContentType()) && node.getParent().getObjectType() == null) {
visible=true;
}
break;
case REFERENCED_PROJECT:
visible=true;
break;
default :
visible=false;
break;
}
}
return visible;
}
Program: 123821
Project: 123821
Buggy source:
private boolean isMappedChild(String tempXpath,String absoluteXPathQuery){
  for (  Object obj : schemaTargets) {
    String relativeXPathQuery="String_Node_Str";
    if (obj instanceof SchemaTarget) {
      relativeXPathQuery=((SchemaTarget)obj).getRelativeXPathQuery();
    }
 else     if (obj instanceof ConceptTarget) {
      relativeXPathQuery=((ConceptTarget)obj).getRelativeLoopExpression();
    }
    final String toAbsolute=absoluteXPathQuery + XmlMapUtil.XPATH_SEPARATOR + relativeXPathQuery;
    if (toAbsolute.startsWith(tempXpath)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isMappedChild(String tempXpath,String absoluteXPathQuery){
  if (targetAbsolutePath == null) {
    targetAbsolutePath=new ArrayList<String>();
    targetAbsolutePath.add(absoluteXPathQuery);
    Pattern regex=Pattern.compile(RELATIVE_PATH_PATTERN,Pattern.CANON_EQ | Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
    for (    Object obj : schemaTargets) {
      String relativeXPathQuery="String_Node_Str";
      if (obj instanceof SchemaTarget) {
        relativeXPathQuery=((SchemaTarget)obj).getRelativeXPathQuery();
      }
 else       if (obj instanceof ConceptTarget) {
        relativeXPathQuery=((ConceptTarget)obj).getRelativeLoopExpression();
      }
      StringBuffer tempAbsolute=new StringBuffer();
      tempAbsolute.append(absoluteXPathQuery);
      tempAbsolute.append(XmlMapUtil.XPATH_SEPARATOR);
      tempAbsolute.append(relativeXPathQuery);
      if (relativeXPathQuery.startsWith(RELATIVE_PATH)) {
        Matcher regexMatcher=regex.matcher(relativeXPathQuery);
        int relativeLength=0;
        while (regexMatcher.find()) {
          relativeLength++;
        }
        if (relativeLength > 0) {
          String subRelativeQuery=relativeXPathQuery.substring(relativeLength * RELATIVE_PATH.length(),relativeXPathQuery.length());
          String[] absoluteSplit=absoluteXPathQuery.split(XmlMapUtil.XPATH_SEPARATOR);
          if (absoluteSplit.length > relativeLength) {
            tempAbsolute=new StringBuffer();
            for (int i=0; i < absoluteSplit.length - relativeLength; i++) {
              tempAbsolute.append(absoluteSplit[i]);
              tempAbsolute.append(XmlMapUtil.XPATH_SEPARATOR);
            }
            tempAbsolute.append(subRelativeQuery);
          }
        }
      }
      targetAbsolutePath.add(tempAbsolute.toString());
    }
  }
  for (  String absTarget : targetAbsolutePath) {
    if (absTarget.startsWith(tempXpath)) {
      return true;
    }
  }
  return false;
}
Program: 123824
Project: 123824
Buggy source:
@Override public String getMessage(){
  StringTokenizer tokenizer=new StringTokenizer(errorMessage,"String_Node_Str");
  StringBuilder sqlError=new StringBuilder();
  if (tokenizer.countTokens() > 2) {
    tokenizer.nextToken();
    sqlError.append(tokenizer.nextToken()).append("String_Node_Str");
  }
  return sqlError.toString();
}

Fixed version (ground truth):
@Override public String getMessage(){
  return Messages.getString("String_Node_Str",System.getProperty("String_Node_Str"));
}
Program: 123825
Project: 123825
Buggy source:
public CsvArray run() throws ProcessorException, PersistenceException {
  CsvArray array=new CsvArray();
  buildProcess();
  IProcessor processor=ProcessorUtilities.getProcessor(process,null);
  processor.setContext(selectContext);
  File previousFile=temppath.toFile();
  if (previousFile.exists()) {
    previousFile.delete();
  }
  java.lang.Process executeprocess=processor.run(IProcessor.NO_STATISTICS,IProcessor.NO_TRACES,null);
  StringBuffer buffer=new StringBuffer();
  ProcessStreamTrashReaderUtil.readAndForget(executeprocess,buffer);
  final String errorMessage=buffer.toString();
  if (!"String_Node_Str".equals(buffer.toString())) {
    throw new PersistenceException(errorMessage){
      private static final long serialVersionUID=1L;
      @Override public synchronized Throwable initCause(      Throwable cause){
        return super.initCause(cause);
      }
      @Override public String getMessage(){
        StringTokenizer tokenizer=new StringTokenizer(errorMessage,"String_Node_Str");
        StringBuilder sqlError=new StringBuilder();
        if (tokenizer.countTokens() > 2) {
          tokenizer.nextToken();
          sqlError.append(tokenizer.nextToken()).append("String_Node_Str");
        }
        return sqlError.toString();
      }
    }
;
  }
 else {
    try {
      array=array.createFrom(previousFile,currentProcessEncoding);
    }
 catch (    IOException ioe) {
      throw new ProcessorException(ioe);
    }
  }
  return array;
}

Fixed version (ground truth):
public CsvArray run() throws ProcessorException {
  CsvArray array=new CsvArray();
  buildProcess();
  IProcessor processor=ProcessorUtilities.getProcessor(process,null);
  processor.setContext(selectContext);
  File previousFile=temppath.toFile();
  if (previousFile.exists()) {
    previousFile.delete();
  }
  java.lang.Process executeprocess=processor.run(IProcessor.NO_STATISTICS,IProcessor.NO_TRACES,null);
  StringBuffer buffer=new StringBuffer();
  ProcessStreamTrashReaderUtil.readAndForget(executeprocess,buffer);
  final String errorMessage=buffer.toString();
  if (!"String_Node_Str".equals(buffer.toString())) {
    throw new ProcessorException(errorMessage){
      private static final long serialVersionUID=1L;
      @Override public synchronized Throwable initCause(      Throwable cause){
        return super.initCause(cause);
      }
      @Override public String getMessage(){
        StringTokenizer tokenizer=new StringTokenizer(errorMessage,"String_Node_Str");
        StringBuilder sqlError=new StringBuilder();
        if (tokenizer.countTokens() > 2) {
          tokenizer.nextToken();
          sqlError.append(tokenizer.nextToken()).append("String_Node_Str");
        }
        return sqlError.toString();
      }
    }
;
  }
 else {
    try {
      array=array.createFrom(previousFile,currentProcessEncoding);
    }
 catch (    IOException ioe) {
      throw new ProcessorException(ioe){
        @Override public String getMessage(){
          return Messages.getString("String_Node_Str",System.getProperty("String_Node_Str"));
        }
      }
;
    }
  }
  return array;
}
Program: 123827
Project: 123827
Buggy source:
private boolean filterRepositoryNode(Object element){
  if (!(element instanceof RepositoryNode)) {
    return false;
  }
  RepositoryNode node=(RepositoryNode)element;
  if (node.isBin()) {
    return false;
  }
  ENodeType nodeType=node.getType();
  boolean visible=false;
  if (nodeType != null) {
switch (nodeType) {
case SYSTEM_FOLDER:
      if (!ERepositoryObjectType.ROUTINES.equals(node.getContentType())) {
        visible=true;
      }
    break;
case STABLE_SYSTEM_FOLDER:
  if (node.getParent() != null && node.getParent().getObjectType() == null && !ERepositoryObjectType.DOCUMENTATION.equals(node.getParent().getContentType())) {
    visible=true;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.SQLPATTERNS.equals(node.getParent().getContentType()) && node.getParent().getObjectType() == null) {
visible=true;
}
break;
case REFERENCED_PROJECT:
visible=true;
break;
default :
visible=false;
break;
}
}
return visible;
}

Fixed version (ground truth):
private boolean filterRepositoryNode(Object element){
  if (!(element instanceof RepositoryNode)) {
    return false;
  }
  RepositoryNode node=(RepositoryNode)element;
  if (node.isBin()) {
    return false;
  }
  ENodeType nodeType=node.getType();
  boolean visible=false;
  if (nodeType != null) {
switch (nodeType) {
case SYSTEM_FOLDER:
      visible=true;
    break;
case STABLE_SYSTEM_FOLDER:
  if (node.getParent() != null && node.getParent().getObjectType() == null && !ERepositoryObjectType.DOCUMENTATION.equals(node.getParent().getContentType()) && !ERepositoryObjectType.ROUTINES.equals(node.getParent().getContentType())) {
    visible=true;
  }
break;
case SIMPLE_FOLDER:
if (ERepositoryObjectType.SQLPATTERNS.equals(node.getParent().getContentType()) && node.getParent().getObjectType() == null) {
visible=true;
}
break;
case REFERENCED_PROJECT:
visible=true;
break;
default :
visible=false;
break;
}
}
return visible;
}
Program: 123831
Project: 123831
Buggy source:
private void checkInitialSelections(){
  for (  UpdateResult result : getInputElements()) {
    result.setChecked(true);
    if (result.isReadOnlyProcess()) {
      result.setChecked(false);
      this.isJobReadOnly=true;
    }
switch (result.getResultType()) {
case RENAME:
case RELOAD:
case JOBLET_UPDATE:
      this.canCancel=false;
    return;
default :
  this.canCancel=true;
}
}
}

Fixed version (ground truth):
private void checkInitialSelections(){
  for (  UpdateResult result : getInputElements()) {
    result.setChecked(true);
    if (result.isReadOnlyProcess()) {
      result.setChecked(false);
      this.isJobReadOnly=true;
    }
switch (result.getResultType()) {
case RENAME:
case RELOAD:
case JOBLET_UPDATE:
      this.canCancel=false;
    this.canDeselect=false;
  return;
default :
this.canCancel=true;
this.canDeselect=true;
}
}
}
Program: 123835
Project: 123835
Buggy source:
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}

Fixed version (ground truth):
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  if (!connParam.isFirstOpenSqlBuilder()) {
    connParam.setQuery("String_Node_Str");
  }
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}
Program: 123837
Project: 123837
Buggy source:
private void deleteNoUseTable(){
  connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  if (node == null) {
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}

Fixed version (ground truth):
private void deleteNoUseTable(){
  connection=(DatabaseConnection)SQLBuilderRepositoryNodeManager.getItem(SQLBuilderRepositoryNodeManager.getRoot(nodeInEditor)).getConnection();
  if (SQLBuilderRepositoryNodeManager.tList instanceof List) {
    if (SQLBuilderRepositoryNodeManager.tList.size() == 0) {
      SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
    }
  }
 else {
    SQLBuilderRepositoryNodeManager.tList=new ArrayList<MetadataTable>();
    SQLBuilderRepositoryNodeManager.tList.addAll(ConnectionHelper.getTables(connection));
  }
  if (SQLBuilderRepositoryNodeManager.tList == null || SQLBuilderRepositoryNodeManager.tList.size() == 0) {
    return;
  }
  if (node == null) {
    SQLBuilderRepositoryNodeManager.tList=null;
    return;
  }
  IRepositoryViewObject repositoryObject=node.getObject();
  Item item=repositoryObject.getProperty().getItem();
  if (item instanceof DatabaseConnectionItem) {
    manager.deleteNouseTables(((DatabaseConnectionItem)item).getConnection());
  }
}
Program: 123838
Project: 123838
Buggy source:
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER | SWT.CLOSE);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}

Fixed version (ground truth):
/** 
 * Creates tab folder.
 */
private void createTabFolder(){
  if (tabFolder == null || tabFolder.isDisposed()) {
    clearParent();
    tabFolder=new CTabFolder(this,SWT.NULL | SWT.BORDER);
    tabFolder.setSimple(false);
    tabFolder.setToolTipText(Messages.getString("String_Node_Str"));
    this.layout();
    this.redraw();
  }
}
Program: 123840
Project: 123840
Buggy source:
@Override public String getRepositoryType(Item item,ERepositoryObjectType type){
  if (item instanceof WSDLSchemaConnectionItem) {
    WSDLSchemaConnection connection=(WSDLSchemaConnection)((WSDLSchemaConnectionItem)item).getConnection();
    if (!connection.isIsInputModel()) {
      return "String_Node_Str";
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public String getRepositoryType(Item item,ERepositoryObjectType type){
  if (item instanceof WSDLSchemaConnectionItem) {
    WSDLSchemaConnection connection=(WSDLSchemaConnection)((WSDLSchemaConnectionItem)item).getConnection();
    if (!connection.isIsInputModel()) {
      return "String_Node_Str";
    }
 else {
      return "String_Node_Str";
    }
  }
  return null;
}
Program: 123841
Project: 123841
Buggy source:
@Override public boolean except(Item item,ERepositoryObjectType type,RepositoryNode seletetedNode,IComponent component,String repositoryType){
  return !valid(item,type,seletetedNode,component,repositoryType);
}

Fixed version (ground truth):
@Override public boolean except(Item item,ERepositoryObjectType type,RepositoryNode seletetedNode,IComponent component,String repositoryType){
  if (!(item instanceof HL7ConnectionItem) || component == null || repositoryType == null) {
    return false;
  }
  return !valid(item,type,seletetedNode,component,repositoryType);
}
Program: 123842
Project: 123842
Buggy source:
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
    inSource.setEncoding(this.charset);
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Parse the XML file. Buffer the result in LoopEntry.
 * @param is InputStream
 */
public void parse(java.io.InputStream is,String charset){
  this.charset=charset;
  try {
    DefaultHandler hd=null;
    SAXParser saxParser=SAXParserFactory.newInstance().newSAXParser();
    if (rootPath == null || rootPath.equals("String_Node_Str")) {
      hd=newHandler();
    }
 else {
      hd=newHandler2();
    }
    saxParser.setProperty("String_Node_Str",hd);
    org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
    saxParser.parse(is,hd);
  }
 catch (  ParserConfigurationException e) {
    e.printStackTrace();
  }
catch (  SAXException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 123843
Project: 123843
Buggy source:
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new java.io.FileInputStream(fileURL));
      inSource.setEncoding(this.charset);
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(is);
      inSource.setEncoding(this.charset);
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset));
      saxParser.parse(inSource,hd);
    }
 else {
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(new UnicodeReader(is,this.charset));
      saxParser.parse(is,hd);
    }
  }
  finally {
    bcache.notifyErrorOccurred();
  }
  return null;
}