nus-yam/ex-repair huggingface dataset:
Program: 129127
Project: 129127
Buggy source:
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}

Fixed version (ground truth):
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    List<String> listExistingObjects=service.getProxyRepositoryFactory().getFolders(type);
    for (    String existName : listExistingObjects) {
      if (existName.equalsIgnoreCase(label)) {
        return false;
      }
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}
Program: 129128
Project: 129128
Buggy source:
public static void replaceInFile(String regex,String fileName,String replacement) throws IOException {
  InputStream in=new FileInputStream(fileName);
  StringBuffer buffer=new StringBuffer();
  try {
    InputStreamReader inR=new InputStreamReader(in);
    BufferedReader buf=new BufferedReader(inR);
    String line;
    while ((line=buf.readLine()) != null) {
      buffer.append(line.replaceAll(regex,replacement)).append("String_Node_Str");
    }
  }
  finally {
    in.close();
  }
  OutputStream os=new FileOutputStream(fileName);
  os.write(buffer.toString().getBytes());
  os.close();
}

Fixed version (ground truth):
public static void replaceInFile(String regex,String fileName,String replacement) throws IOException {
  InputStream in=new FileInputStream(fileName);
  StringBuffer buffer=new StringBuffer();
  try {
    InputStreamReader inR=new InputStreamReader(in);
    BufferedReader buf=new BufferedReader(inR);
    String line;
    while ((line=buf.readLine()) != null) {
      buffer.append(StringUtils.replace(line,regex,replacement)).append("String_Node_Str");
    }
  }
 catch (  Exception e) {
    logger.error(e);
  }
 finally {
    in.close();
  }
  OutputStream os=new FileOutputStream(fileName);
  os.write(buffer.toString().getBytes());
  os.close();
}
Program: 129129
Project: 129129
Buggy source:
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cachedchildren and by creating a viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}

Fixed version (ground truth):
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cached children and by creatinga viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}
Program: 129130
Project: 129130
Buggy source:
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public Object getImage(Object object){
  return overlayImage(object,getResourceLocator().getImage("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 */
public Object getImage(Object object){
  return ImageDescriptor.createFromFile(ECoreImage.class,ECoreImage.SERVICES_ICON.getPath()).createImage();
}
Program: 129132
Project: 129132
Buggy source:
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}

Fixed version (ground truth):
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER)) {
        isLock=true;
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}
Program: 129134
Project: 129134
Buggy source:
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    List<String> listExistingObjects=service.getProxyRepositoryFactory().getFolders(type);
    for (    String existName : listExistingObjects) {
      if (existName.equalsIgnoreCase(label)) {
        return false;
      }
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}

Fixed version (ground truth):
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}
Program: 129137
Project: 129137
Buggy source:
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}

Fixed version (ground truth):
private void lockObject(){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IProxyRepositoryService.class)) {
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    IProxyRepositoryFactory repositoryFactory=service.getProxyRepositoryFactory();
    try {
      boolean isOpened=false;
      if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
        ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
        isOpened=coreService.isOpenedItemInEditor(object);
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER)) {
        isLock=true;
      }
      if (repositoryFactory.getStatus(object).equals(ERepositoryStatus.LOCK_BY_USER) && isOpened) {
        alreadyEditedByUser=true;
      }
 else {
        repositoryFactory.lock(object);
      }
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    BusinessException e) {
    }
  }
}
Program: 129138
Project: 129138
Buggy source:
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cachedchildren and by creating a viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}

Fixed version (ground truth):
/** 
 * This handles model notifications by calling   {@link #updateChildren} to update any cached children and by creatinga viewer notification, which it passes to  {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void notifyChanged(Notification notification){
  updateChildren(notification);
  super.notifyChanged(notification);
}
Program: 129139
Project: 129139
Buggy source:
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public Object getImage(Object object){
  return overlayImage(object,getResourceLocator().getImage("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * This returns Service.gif. <!-- begin-user-doc --> <!-- end-user-doc -->
 */
public Object getImage(Object object){
  return ImageDescriptor.createFromFile(ECoreImage.class,ECoreImage.SERVICES_ICON.getPath()).createImage();
}
Program: 129140
Project: 129140
Buggy source:
private void renameFolderForLocal(final ERepositoryObjectType type,final IPath sourcePath,final String label) throws PersistenceException {
  IPath lastPath=sourcePath;
  if (sourcePath.lastSegment().equalsIgnoreCase(label)) {
    String tmpLabel=label.concat(this.getNextId());
    renameFolder(type,sourcePath,tmpLabel);
    lastPath=sourcePath.removeLastSegments(1).append(tmpLabel);
  }
  renameFolder(type,lastPath,label);
}

Fixed version (ground truth):
private void renameFolderForLocal(final ERepositoryObjectType type,final IPath sourcePath,final String label) throws PersistenceException {
  IPath lastPath=sourcePath;
  if (sourcePath.lastSegment().equalsIgnoreCase(label)) {
    String tmpLabel=label.concat(this.getNextId());
    renameFolderExecute(type,sourcePath,tmpLabel);
    lastPath=sourcePath.removeLastSegments(1).append(tmpLabel);
  }
  renameFolderExecute(type,lastPath,label);
}
Program: 129143
Project: 129143
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
  }
 catch (  CoreException e) {
    throw new InvocationTargetException(e);
  }
}
Program: 129145
Project: 129145
Buggy source:
@Override protected void doRun(){
  if (sourceNode == null) {
    return;
  }
  Property property=sourceNode.getObject().getProperty();
  Property updatedProperty=null;
  try {
    updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())),property.getId()).getProperty();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  String initNameValue="String_Node_Str" + sourceNode.getObject().getProperty().getItem().getProperty().getLabel();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  final TreeSelection selectionInClipboard=(TreeSelection)selection;
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  String jobNameValue=null;
  try {
    jobNameValue=getDuplicateName(initNameValue,selectionInClipboard);
  }
 catch (  BusinessException e) {
    jobNameValue="String_Node_Str";
  }
  InputDialog jobNewNameDialog=new InputDialog(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),jobNameValue,new IInputValidator(){
    public String isValid(    String newText){
      return validJobName(newText,selectionInClipboard);
    }
  }
);
  if (jobNewNameDialog.open() != Dialog.OK) {
    return;
  }
  String jobNewName=jobNewNameDialog.getValue();
  createOperation(jobNewName,sourceNode,copyObjectAction,selectionInClipboard);
}

Fixed version (ground truth):
@Override protected void doRun(){
  if (sourceNode == null) {
    return;
  }
  Property property=sourceNode.getObject().getProperty();
  Property updatedProperty=null;
  try {
    updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(property.getItem())),property.getId()).getProperty();
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  String initNameValue="String_Node_Str" + sourceNode.getObject().getProperty().getItem().getProperty().getLabel();
  CopyObjectAction copyObjectAction=CopyObjectAction.getInstance();
  final TreeSelection selectionInClipboard=(TreeSelection)selection;
  promptForSavingIfNecessary((RepositoryNode)selection.getFirstElement());
  String jobNameValue=null;
  try {
    jobNameValue=getDuplicateName(initNameValue,selectionInClipboard);
  }
 catch (  BusinessException e) {
    jobNameValue="String_Node_Str";
  }
  InputDialog jobNewNameDialog=new InputDialog(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),jobNameValue,new IInputValidator(){
    @Override public String isValid(    String newText){
      return validJobName(newText,selectionInClipboard);
    }
  }
);
  if (jobNewNameDialog.open() != Dialog.OK) {
    return;
  }
  String jobNewName=jobNewNameDialog.getValue();
  createOperation(jobNewName,sourceNode,copyObjectAction,selectionInClipboard);
}
Program: 129146
Project: 129146
Buggy source:
private void addExtensionRepositoryNodes(List<ERepositoryObjectType> arraysList){
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (int i=0; i < configurationElements.length; i++) {
    IConfigurationElement element=configurationElements[i];
    String type=element.getAttribute("String_Node_Str");
    ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
    if (repositoryNodeType != null) {
      arraysList.add(repositoryNodeType);
    }
  }
}

Fixed version (ground truth):
private void addExtensionRepositoryNodes(List<ERepositoryObjectType> arraysList){
  IExtensionRegistry registry=Platform.getExtensionRegistry();
  IConfigurationElement[] configurationElements=registry.getConfigurationElementsFor("String_Node_Str");
  for (  IConfigurationElement element : configurationElements) {
    String type=element.getAttribute("String_Node_Str");
    ERepositoryObjectType repositoryNodeType=ERepositoryObjectType.valueOf(ERepositoryObjectType.class,type);
    if (repositoryNodeType != null) {
      arraysList.add(repositoryNodeType);
    }
  }
}
Program: 129151
Project: 129151
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  Relation other=(Relation)obj;
  if (id == null) {
    if (other.id != null)     return false;
  }
 else   if (!id.equals(other.id))   return false;
  if (type == null) {
    if (other.type != null)     return false;
  }
 else   if (!type.equals(other.type))   return false;
  if (version == null) {
    if (other.version != null)     return false;
  }
 else   if (!version.equals(other.version))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  Relation other=(Relation)obj;
  if (id == null) {
    if (other.id != null) {
      return false;
    }
  }
 else   if (!id.equals(other.id)) {
    return false;
  }
  if (type == null) {
    if (other.type != null) {
      return false;
    }
  }
 else   if (!type.equals(other.type)) {
    return false;
  }
  if (version == null) {
    if (other.version != null) {
      return false;
    }
  }
 else   if (!version.equals(other.version)) {
    return false;
  }
  return true;
}
Program: 129152
Project: 129152
Buggy source:
protected Object clone() throws CloneNotSupportedException {
  return super.clone();
}

Fixed version (ground truth):
@Override protected Object clone() throws CloneNotSupportedException {
  return super.clone();
}
Program: 129154
Project: 129154
Buggy source:
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null)   return contextPara.getValue();
  return null;
}

Fixed version (ground truth):
/** 
 * Looks up the context parameter value under the specified context.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private String lookupContextParameterValue(String sourceId,String contextParaName,int index){
  IContextParameter contextPara=lookupContextParameter(sourceId,contextParaName,index);
  if (contextPara != null)   return ContextParameterUtils.checkAndHideValue(contextPara);
  return null;
}
Program: 129155
Project: 129155
Buggy source:
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return contextPara.getValue();
        }
      }
    }
  }
  return text;
}

Fixed version (ground truth):
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return ContextParameterUtils.checkAndHideValue(contextPara);
        }
      }
    }
  }
  return text;
}
Program: 129156
Project: 129156
Buggy source:
protected void retrieveItemTables(IMetadataConnection metadataConnection,TableInfoParameters tableInfoParameters,List<String> itemTablesName) throws SQLException {
  Set<String> nameFiters=tableInfoParameters.getNameFilters();
  if (nameFiters.isEmpty()) {
    itemTablesName=getTableNamesFromTablesForMultiSchema(tableInfoParameters,"String_Node_Str",metadataConnection);
  }
 else {
    for (    String s : nameFiters) {
      List<String> tableNamesFromTables=getTableNamesFromTablesForMultiSchema(tableInfoParameters,s,metadataConnection);
      for (      String string : tableNamesFromTables) {
        if (!itemTablesName.contains(string)) {
          itemTablesName.add(string);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected List<String> retrieveItemTables(IMetadataConnection metadataConnection,TableInfoParameters tableInfoParameters,List<String> itemTablesName) throws SQLException {
  Set<String> nameFiters=tableInfoParameters.getNameFilters();
  if (nameFiters.isEmpty()) {
    itemTablesName=getTableNamesFromTablesForMultiSchema(tableInfoParameters,"String_Node_Str",metadataConnection);
  }
 else {
    for (    String s : nameFiters) {
      List<String> tableNamesFromTables=getTableNamesFromTablesForMultiSchema(tableInfoParameters,s,metadataConnection);
      for (      String string : tableNamesFromTables) {
        if (!itemTablesName.contains(string)) {
          itemTablesName.add(string);
        }
      }
    }
  }
  return itemTablesName;
}
Program: 129158
Project: 129158
Buggy source:
@Override protected void retrieveItemTables(IMetadataConnection metadataConnection,TableInfoParameters tableInfoParameters,List<String> itemTablesName) throws SQLException {
  if (ExtractMetaDataUtils.conn != null && ExtractMetaDataUtils.conn.toString().contains("String_Node_Str") && ExtractMetaDataUtils.isUseAllSynonyms()) {
    Set<String> nameFiters=tableInfoParameters.getNameFilters();
    Statement stmt=ExtractMetaDataUtils.conn.createStatement();
    ExtractMetaDataUtils.setQueryStatementTimeout(stmt);
    StringBuffer filters=new StringBuffer();
    if (!nameFiters.isEmpty()) {
      filters.append("String_Node_Str");
      final String tStr="String_Node_Str";
      int i=0;
      for (      String s : nameFiters) {
        if (i != 0) {
          filters.append("String_Node_Str");
        }
        filters.append(tStr);
        filters.append(s);
        filters.append('\'');
        i++;
      }
      filters.append(')');
    }
    ResultSet rsTables=stmt.executeQuery(GET_ALL_SYNONYMS + filters.toString());
    itemTablesName=ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables);
    rsTables.close();
    stmt.close();
    for (    String synonymName : itemTablesName) {
      getTableTypeMap().put(synonymName,ETableTypes.TABLETYPE_SYNONYM.getName());
    }
  }
 else {
    super.retrieveItemTables(metadataConnection,tableInfoParameters,itemTablesName);
  }
}

Fixed version (ground truth):
@Override protected List<String> retrieveItemTables(IMetadataConnection metadataConnection,TableInfoParameters tableInfoParameters,List<String> itemTablesName) throws SQLException {
  if (ExtractMetaDataUtils.conn != null && ExtractMetaDataUtils.conn.toString().contains("String_Node_Str") && ExtractMetaDataUtils.isUseAllSynonyms()) {
    Set<String> nameFiters=tableInfoParameters.getNameFilters();
    Statement stmt=ExtractMetaDataUtils.conn.createStatement();
    ExtractMetaDataUtils.setQueryStatementTimeout(stmt);
    StringBuffer filters=new StringBuffer();
    if (!nameFiters.isEmpty()) {
      filters.append("String_Node_Str");
      final String tStr="String_Node_Str";
      int i=0;
      for (      String s : nameFiters) {
        if (i != 0) {
          filters.append("String_Node_Str");
        }
        filters.append(tStr);
        filters.append(s);
        filters.append('\'');
        i++;
      }
      filters.append(')');
    }
    ResultSet rsTables=stmt.executeQuery(GET_ALL_SYNONYMS + filters.toString());
    itemTablesName=ExtractMetaDataFromDataBase.getTableNamesFromQuery(rsTables);
    rsTables.close();
    stmt.close();
    for (    String synonymName : itemTablesName) {
      getTableTypeMap().put(synonymName,ETableTypes.TABLETYPE_SYNONYM.getName());
    }
  }
 else {
    itemTablesName=super.retrieveItemTables(metadataConnection,tableInfoParameters,itemTablesName);
  }
  return itemTablesName;
}
Program: 129159
Project: 129159
Buggy source:
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IProxyRepositoryService service=(IProxyRepositoryService)GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
    List<String> listExistingObjects=service.getProxyRepositoryFactory().getFolders(type);
    for (    String existName : listExistingObjects) {
      if (existName.equalsIgnoreCase(label)) {
        return false;
      }
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}

Fixed version (ground truth):
@Override public boolean isPathValid(Project project,ERepositoryObjectType type,IPath path,String label) throws PersistenceException {
  if (path == null) {
    return false;
  }
  if (label.equalsIgnoreCase("String_Node_Str")) {
    return false;
  }
 else   if (RepositoryConstants.isSystemFolder(label) || RepositoryConstants.isGeneratedFolder(label) || RepositoryConstants.isJobsFolder(label)|| RepositoryConstants.isJobletsFolder(label)) {
    return false;
  }
 else {
    IProject fsProject=ResourceModelUtils.getProject(project);
    String completePath=null;
    if (type.equals(ERepositoryObjectType.TDQ_PATTERN_REGEX)) {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + label.toString();
    }
 else {
      completePath=ERepositoryObjectType.getFolderName(type) + IPath.SEPARATOR + path.toString();
      completePath=completePath + IPath.SEPARATOR + label;
    }
    IFolder existingFolder=ResourceUtils.getFolder(fsProject,completePath,false);
    return !existingFolder.exists();
  }
}
Program: 129160
Project: 129160
Buggy source:
public void openEditSchemaWizard(String value){
  final RepositoryNode realNode=RepositoryNodeUtilities.getMetadataTableFromConnection(value);
  if (realNode != null) {
    AbstractCreateTableAction action=new CreateTableAction(){
      @Override public ISelection getSelection(){
        return new StructuredSelection(realNode);
      }
    }
;
    action.run();
  }
}

Fixed version (ground truth):
@Override public void openEditSchemaWizard(String value){
  final RepositoryNode realNode=RepositoryNodeUtilities.getMetadataTableFromConnection(value);
  if (realNode != null) {
    AbstractCreateTableAction action=new CreateTableAction(){
      @Override public ISelection getSelection(){
        return new StructuredSelection(realNode);
      }
    }
;
    action.run();
  }
}
Program: 129161
Project: 129161
Buggy source:
public Property getPropertyFromWizardDialog(){
  if (this.genericSchemaWizard != null) {
    return this.genericSchemaWizard.getConnectionProperty();
  }
  return null;
}

Fixed version (ground truth):
@Override public Property getPropertyFromWizardDialog(){
  if (this.genericSchemaWizard != null) {
    return this.genericSchemaWizard.getConnectionProperty();
  }
  return null;
}
Program: 129162
Project: 129162
Buggy source:
public IPath getPathForSaveAsGenericSchema(){
  if (this.genericSchemaWizard != null) {
    return this.genericSchemaWizard.getPathForSaveAsGenericSchema();
  }
  return null;
}

Fixed version (ground truth):
@Override public IPath getPathForSaveAsGenericSchema(){
  if (this.genericSchemaWizard != null) {
    return this.genericSchemaWizard.getPathForSaveAsGenericSchema();
  }
  return null;
}
Program: 129164
Project: 129164
Buggy source:
public WizardDialog getGenericSchemaWizardDialog(Shell shell,IWorkbench workbench,boolean creation,ISelection selection,String[] existingNames,boolean isSinglePageOnly){
  genericSchemaWizard=new GenericSchemaWizard(workbench,creation,selection,existingNames,isSinglePageOnly);
  return new WizardDialog(shell,genericSchemaWizard);
}

Fixed version (ground truth):
@Override public WizardDialog getGenericSchemaWizardDialog(Shell shell,IWorkbench workbench,boolean creation,ISelection selection,String[] existingNames,boolean isSinglePageOnly){
  genericSchemaWizard=new GenericSchemaWizard(workbench,creation,selection,existingNames,isSinglePageOnly);
  return new WizardDialog(shell,genericSchemaWizard);
}
Program: 129165
Project: 129165
Buggy source:
public boolean performCancel(){
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  return super.performCancel();
}
Program: 129166
Project: 129166
Buggy source:
public boolean performFinish(){
  return false;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  return false;
}
Program: 129168
Project: 129168
Buggy source:
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  if (page3 == null) {
    formIsPerformed=page1.isPageComplete();
  }
 else {
    formIsPerformed=page3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,excelFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        boolean isModified=excelFileWizardPage0.isNameModifiedByUser();
        if (isModified) {
          if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
            IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
            if (service != null) {
              service.refreshComponentView(connectionItem);
            }
          }
        }
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  if (page3 == null) {
    formIsPerformed=page1.isPageComplete();
  }
 else {
    formIsPerformed=page3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,excelFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        refreshInFinish(excelFileWizardPage0.isNameModifiedByUser());
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 129172
Project: 129172
Buggy source:
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  formIsPerformed=page1.isPageComplete();
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,salesforceSchemaWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        boolean isModified=salesforceSchemaWizardPage0.isNameModifiedByUser();
        if (isModified) {
          if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
            IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
            if (service != null) {
              service.refreshComponentView(connectionItem);
            }
          }
        }
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  formIsPerformed=page1.isPageComplete();
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,salesforceSchemaWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        refreshInFinish(salesforceSchemaWizardPage0.isNameModifiedByUser());
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 129174
Project: 129174
Buggy source:
@Override public boolean performFinish(){
  if (isSinglePageOnly) {
    return true;
  }
  boolean formIsPerformed;
  if (ldapSchemaWizardPage4 == null) {
    formIsPerformed=ldapSchemaWizardPage3.isPageComplete();
  }
 else {
    formIsPerformed=ldapSchemaWizardPage4.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,ldapSchemaWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
        boolean isModified=ldapSchemaWizardPage0.isNameModifiedByUser();
        if (isModified) {
          if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreService.class)) {
            IDesignerCoreService service=(IDesignerCoreService)GlobalServiceRegister.getDefault().getService(IDesignerCoreService.class);
            if (service != null) {
              service.refreshComponentView(connectionItem);
            }
          }
        }
        updateConnectionItem();
      }
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (isSinglePageOnly) {
    return true;
  }
  boolean formIsPerformed;
  if (ldapSchemaWizardPage4 == null) {
    formIsPerformed=ldapSchemaWizardPage3.isPageComplete();
  }
 else {
    formIsPerformed=ldapSchemaWizardPage4.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,ldapSchemaWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateMultiSchema(connectionItem,oldMetadataTable,oldTableMap);
        refreshInFinish(ldapSchemaWizardPage0.isNameModifiedByUser());
        updateConnectionItem();
      }
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 129175
Project: 129175
Buggy source:
/** 
 * ggu Comment method "getQueriesFromItemId". get queries from the item.
 */
public static List<Query> getQueriesFromItemId(final String itemId){
  ConnectionItem item=getConnectionItemByItemId(itemId);
  if (item != null) {
    final Connection connection=item.getConnection();
    if (connection != null) {
      final QueriesConnection queryConn=connection.getQueries();
      if (queryConn != null) {
        final EList query=queryConn.getQuery();
        if (query != null) {
          return (List<Query>)query;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getQueriesFromItemId". get queries from the item.
 */
public static List<Query> getQueriesFromItemId(final String itemId){
  ConnectionItem item=getConnectionItemByItemId(itemId);
  if (item != null) {
    final Connection connection=item.getConnection();
    if (connection != null) {
      final QueriesConnection queryConn=connection.getQueries();
      if (queryConn != null) {
        final EList query=queryConn.getQuery();
        if (query != null) {
          return query;
        }
      }
    }
  }
  return null;
}
Program: 129176
Project: 129176
Buggy source:
/** 
 * ggu Comment method "getRepositoryObjectById".
 * @param id
 * @return
 */
public static IRepositoryViewObject getRepositoryObjectById(final String id){
  if (id == null || "String_Node_Str".equals(id) || RepositoryNode.NO_ID.equals(id)) {
    return null;
  }
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    IRepositoryViewObject lastVersion=factory.getLastVersion(id);
    if (lastVersion != null && factory.getStatus(lastVersion) != ERepositoryStatus.DELETED) {
      return lastVersion;
    }
  }
 catch (  PersistenceException e) {
  }
  return null;
}

Fixed version (ground truth):
public static IRepositoryViewObject getRepositoryObjectById(final String id,boolean withDeleted){
  if (id == null || "String_Node_Str".equals(id) || RepositoryNode.NO_ID.equals(id)) {
    return null;
  }
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    IRepositoryViewObject lastVersion=factory.getLastVersion(id);
    if (lastVersion != null) {
      if (withDeleted) {
        return lastVersion;
      }
 else       if (factory.getStatus(lastVersion) != ERepositoryStatus.DELETED) {
        return lastVersion;
      }
    }
  }
 catch (  PersistenceException e) {
  }
  return null;
}
Program: 129177
Project: 129177
Buggy source:
public static List<Query> getQueriesFromItem(Item item){
  if (item == null) {
    return null;
  }
  if (item instanceof ConnectionItem) {
    final Connection connection=((ConnectionItem)item).getConnection();
    if (connection != null) {
      final QueriesConnection queryConn=connection.getQueries();
      if (queryConn != null) {
        final EList query=queryConn.getQuery();
        if (query != null) {
          return (List<Query>)query;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<Query> getQueriesFromItem(Item item){
  if (item == null) {
    return null;
  }
  if (item instanceof ConnectionItem) {
    final Connection connection=((ConnectionItem)item).getConnection();
    if (connection != null) {
      final QueriesConnection queryConn=connection.getQueries();
      if (queryConn != null) {
        final EList query=queryConn.getQuery();
        if (query != null) {
          return query;
        }
      }
    }
  }
  return null;
}
Program: 129178
Project: 129178
Buggy source:
public void startThreadStat(String clientHost,int portStats) throws java.io.IOException, java.net.UnknownHostException {
}

Fixed version (ground truth):
public void startThreadStat(String clientHost,int portStats) throws java.io.IOException, java.net.UnknownHostException {
  if (!openSocket) {
    Socket s=null;
    Object object=GlobalResource.resourceMap.get(portStats);
    OutputStream output=null;
    if (object == null || !(object instanceof Socket)) {
      String lastCallerJobName=new Exception().getStackTrace()[1].getClassName();
      System.err.println("String_Node_Str" + lastCallerJobName + "String_Node_Str"+ "String_Node_Str");
      output=System.out;
    }
 else {
      s=(Socket)object;
      output=s.getOutputStream();
    }
    if (debug) {
      output=System.out;
    }
    pred=new java.io.PrintWriter(new java.io.BufferedWriter(new java.io.OutputStreamWriter(output)),true);
    Thread t=new Thread(this);
    t.start();
    return;
  }
  System.out.println("String_Node_Str" + portStats);
  boolean isConnect=false;
  OutputStream output=null;
  try {
    s=new Socket(clientHost,portStats);
    isConnect=true;
  }
 catch (  Exception e) {
    System.err.println("String_Node_Str" + clientHost + "String_Node_Str"+ portStats);
  }
  if (isConnect) {
    GlobalResource.resourceMap.put(portStats,s);
    output=s.getOutputStream();
    System.out.println("String_Node_Str");
  }
 else {
    output=System.out;
    System.out.println("String_Node_Str");
  }
  if (debug) {
    output=System.out;
  }
  pred=new java.io.PrintWriter(new java.io.BufferedWriter(new java.io.OutputStreamWriter(output)),true);
  Thread t=new Thread(this);
  t.start();
}
Program: 129179
Project: 129179
Buggy source:
public void run(){
  if (!debug) {
synchronized (this) {
      try {
        while (!jobIsFinished) {
          sendMessages();
          wait(1000);
        }
      }
 catch (      InterruptedException e) {
        System.out.println("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (!debug) {
synchronized (this) {
      try {
        while (!jobIsFinished) {
          sendMessages();
          wait(1000);
        }
      }
 catch (      InterruptedException e) {
        System.out.println("String_Node_Str");
      }
    }
  }
}