nus-yam/ex-repair huggingface dataset:
Program: 128188
Project: 128188
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
@Override public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}
Program: 128189
Project: 128189
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128190
Project: 128190
Buggy source:
public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128191
Project: 128191
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}
Program: 128192
Project: 128192
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
@Override public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}
Program: 128193
Project: 128193
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128194
Project: 128194
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}
Program: 128195
Project: 128195
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
@Override public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}
Program: 128196
Project: 128196
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128197
Project: 128197
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}
Program: 128199
Project: 128199
Buggy source:
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128200
Project: 128200
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}
Program: 128201
Project: 128201
Buggy source:
public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}
Program: 128202
Project: 128202
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128203
Project: 128203
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
  addPage(tableWizardpage);
}
Program: 128204
Project: 128204
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
@Override public boolean performFinish(){
  if (tableWizardpage.isPageComplete()) {
    RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      factory.save(repositoryObject.getProperty().getItem());
      closeLockStrategy();
    }
 catch (    PersistenceException 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 true;
  }
 else {
    return false;
  }
}
Program: 128205
Project: 128205
Buggy source:
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}

Fixed version (ground truth):
/** 
 * We will accept the selection in the workbench to see if we can initialize from it.
 * @see IWorkbenchWizard#init(IWorkbench,IStructuredSelection)
 */
@Override public void init(final IWorkbench workbench,final IStructuredSelection selection){
  this.selection=selection;
}
Program: 128206
Project: 128206
Buggy source:
@Override public boolean performCancel(){
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128207
Project: 128207
Buggy source:
/** 
 * Adding the page to the wizard.
 */
public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  addPage(tableWizardpage);
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
}

Fixed version (ground truth):
/** 
 * Adding the page to the wizard.
 */
@Override public void addPages(){
  setWindowTitle(Messages.getString("String_Node_Str"));
  tableWizardpage=new FileTableWizardPage(connectionItem,metadataTable,isRepositoryObjectEditable());
  addPage(tableWizardpage);
  if (creation) {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",connectionItem.getProperty().getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(false);
  }
 else {
    tableWizardpage.setTitle(Messages.getString("String_Node_Str",metadataTable.getLabel()));
    tableWizardpage.setDescription(Messages.getString("String_Node_Str"));
    tableWizardpage.setPageComplete(isRepositoryObjectEditable());
  }
}
Program: 128208
Project: 128208
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  if (!tableWizardpage.isPageComplete()) {
    return false;
  }
  RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    factory.save(repositoryObject.getProperty().getItem());
    closeLockStrategy();
  }
 catch (  PersistenceException 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 true;
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
@Override public boolean performFinish(){
  if (!tableWizardpage.isPageComplete()) {
    return false;
  }
  RepositoryUpdateManager.updateSingleSchema(connectionItem,metadataTable,oldMetadataTable,oldTableMap);
  IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  try {
    factory.save(repositoryObject.getProperty().getItem());
    closeLockStrategy();
  }
 catch (  PersistenceException 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 true;
}
Program: 128210
Project: 128210
Buggy source:
@Override public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128211
Project: 128211
Buggy source:
@Override public boolean performCancel(){
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128213
Project: 128213
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  IPath path=resource.getFullPath();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null) {
      int matchingFirstSegments=path.matchingFirstSegments(topLevelNodeWorkspaceRelativePath);
      if (path.segmentCount() == matchingFirstSegments || matchingFirstSegments == topLevelNodeWorkspaceRelativePath.segmentCount()) {
        if ((delta.getAffectedChildren().length == 0) && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || (resource instanceof IContainer))) {
          if (viewer instanceof RepoViewCommonViewer) {
            runnables.add(new Runnable(){
              @Override public void run(){
                refreshTopLevelNode(repoNode);
              }
            }
);
          }
          return false;
        }
 else {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  boolean talendProChange=false;
  IResource resource=delta.getResource();
  IPath path=resource.getFullPath();
  if (path != null && path.lastSegment() != null) {
    talendProChange=FileConstants.LOCAL_PROJECT_FILENAME.equals(path.lastSegment());
  }
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null) {
      int matchingFirstSegments=path.matchingFirstSegments(topLevelNodeWorkspaceRelativePath);
      if (path.segmentCount() == matchingFirstSegments || matchingFirstSegments == topLevelNodeWorkspaceRelativePath.segmentCount() || talendProChange) {
        if ((delta.getAffectedChildren().length == 0) && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || talendProChange || (resource instanceof IContainer))) {
          if (viewer instanceof RepoViewCommonViewer) {
            runnables.add(new Runnable(){
              @Override public void run(){
                refreshTopLevelNode(repoNode);
              }
            }
);
          }
          return false;
        }
 else {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 128214
Project: 128214
Buggy source:
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  IResource resource=delta.getResource();
  IPath path=resource.getFullPath();
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null) {
      int matchingFirstSegments=path.matchingFirstSegments(topLevelNodeWorkspaceRelativePath);
      if (path.segmentCount() == matchingFirstSegments || matchingFirstSegments == topLevelNodeWorkspaceRelativePath.segmentCount()) {
        if ((delta.getAffectedChildren().length == 0) && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || (resource instanceof IContainer))) {
          if (viewer instanceof RepoViewCommonViewer) {
            runnables.add(new Runnable(){
              @Override public void run(){
                refreshTopLevelNode(repoNode);
              }
            }
);
          }
          return false;
        }
 else {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean visit(IResourceDelta delta,Collection<Runnable> runnables){
  boolean talendProChange=false;
  IResource resource=delta.getResource();
  IPath path=resource.getFullPath();
  if (path != null && path.lastSegment() != null) {
    talendProChange=FileConstants.LOCAL_PROJECT_FILENAME.equals(path.lastSegment());
  }
  Set<RepositoryNode> topLevelNodes=getTopLevelNodes();
  for (  final RepositoryNode repoNode : topLevelNodes) {
    IPath topLevelNodeWorkspaceRelativePath=topLevelNodeToPathMap.get(repoNode);
    if (topLevelNodeWorkspaceRelativePath != null) {
      int matchingFirstSegments=path.matchingFirstSegments(topLevelNodeWorkspaceRelativePath);
      if (path.segmentCount() == matchingFirstSegments || matchingFirstSegments == topLevelNodeWorkspaceRelativePath.segmentCount() || talendProChange) {
        if ((delta.getAffectedChildren().length == 0) && (FileConstants.PROPERTIES_EXTENSION.equals(path.getFileExtension()) || talendProChange || (resource instanceof IContainer))) {
          if (viewer instanceof RepoViewCommonViewer) {
            runnables.add(new Runnable(){
              @Override public void run(){
                refreshTopLevelNode(repoNode);
              }
            }
);
          }
          return false;
        }
 else {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 128215
Project: 128215
Buggy source:
public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  return super.performCancel();
}

Fixed version (ground truth):
public boolean performCancel(){
  if (creation) {
    Connection connection=connectionItem.getConnection();
    GenericPackage g=(GenericPackage)ConnectionHelper.getPackage(connection.getName(),connection,GenericPackage.class);
    g.getOwnedElement().remove(metadataTable);
  }
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128216
Project: 128216
Buggy source:
@Override public boolean performCancel(){
  return super.performCancel();
}

Fixed version (ground truth):
public boolean performCancel(){
  if (metadataTable != null && oldMetadataTable != null && metadataTable.getLabel() != null && !metadataTable.getLabel().equals(oldMetadataTable.getLabel())) {
    this.metadataTable.setLabel(oldMetadataTable.getLabel());
  }
  return super.performCancel();
}
Program: 128218
Project: 128218
Buggy source:
public void modifyText(ModifyEvent e){
  property.setStatusCode(statusHelper.getStatusCode(statusText.getText()));
  updatePageStatus();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  property.setStatusCode(statusHelper.getStatusCode(statusText.getText()));
  property.setModificationDate(new Date());
  updatePageStatus();
}
Program: 128220
Project: 128220
Buggy source:
protected void evaluateTextField(){
  if (readOnly) {
    return;
  }
  if (nameText == null || nameText.isDisposed()) {
    return;
  }
  if (nameText.getText().length() == 0) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (!Pattern.matches(RepositoryConstants.getPattern(getRepositoryObjectType()),nameText.getText()) || nameText.getText().trim().contains("String_Node_Str")) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (isKeywords(nameText.getText()) || "String_Node_Str".equalsIgnoreCase(nameText.getText())) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (nameModifiedByUser) {
    if (retrieveNameFinished) {
      if (!isValid(nameText.getText())) {
        nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
      }
 else {
        nameStatus=createOkStatus();
      }
    }
 else {
      nameStatus=createStatus(IStatus.ERROR,"String_Node_Str");
    }
  }
 else {
    nameStatus=createOkStatus();
  }
  if (property != null && nameStatus.getSeverity() == IStatus.OK) {
    property.setLabel(StringUtils.trimToNull(nameText.getText()));
    property.setDisplayName(StringUtils.trimToNull(nameText.getText()));
  }
  updatePageStatus();
}

Fixed version (ground truth):
protected void evaluateTextField(){
  if (readOnly) {
    return;
  }
  if (nameText == null || nameText.isDisposed()) {
    return;
  }
  if (nameText.getText().length() == 0) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (!Pattern.matches(RepositoryConstants.getPattern(getRepositoryObjectType()),nameText.getText()) || nameText.getText().trim().contains("String_Node_Str")) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (isKeywords(nameText.getText()) || "String_Node_Str".equalsIgnoreCase(nameText.getText())) {
    nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
  }
 else   if (nameModifiedByUser) {
    if (retrieveNameFinished) {
      if (!isValid(nameText.getText())) {
        nameStatus=createStatus(IStatus.ERROR,Messages.getString("String_Node_Str"));
      }
 else {
        nameStatus=createOkStatus();
      }
    }
 else {
      nameStatus=createStatus(IStatus.ERROR,"String_Node_Str");
    }
  }
 else {
    nameStatus=createOkStatus();
  }
  if (property != null && nameStatus.getSeverity() == IStatus.OK) {
    property.setLabel(StringUtils.trimToNull(nameText.getText()));
    property.setDisplayName(StringUtils.trimToNull(nameText.getText()));
    property.setModificationDate(new Date());
  }
  updatePageStatus();
}
Program: 128221
Project: 128221
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String version=property.getVersion();
  if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
    version=lastVersionFound;
  }
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  property.setVersion(version);
  property.setCreationDate(new Date());
  updatePageStatus();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String version=property.getVersion();
  if (lastVersionFound != null && VersionUtils.compareTo(lastVersionFound,version) > 0) {
    version=lastVersionFound;
  }
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  property.setVersion(version);
  property.setCreationDate(new Date());
  property.setModificationDate(new Date());
  updatePageStatus();
}
Program: 128225
Project: 128225
Buggy source:
private boolean pageComplete(){
  if (parentWizardPage instanceof SelectorTableWizardPage) {
    List<MetadataTable> list=new ArrayList<MetadataTable>();
    Set<MetadataTable> oldTables=((SelectorTableWizardPage)parentWizardPage).getOldTables();
    Set<MetadataTable> tables=ConnectionHelper.getTables(getConnection());
    if (oldTables != null && oldTables.size() > 0) {
      for (      MetadataTable table : tables) {
        boolean found=false;
        for (        MetadataTable oldtable : oldTables) {
          if (table != null && oldtable != null && table.getLabel().equals(oldtable.getLabel())) {
            found=true;
            break;
          }
        }
        if (table != null && !found) {
          list.add(table);
        }
      }
    }
 else {
      list.addAll(tables);
    }
    if (forTemplate && list.size() <= 0) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean pageComplete(){
  if (parentWizardPage instanceof SelectorTableWizardPage) {
    List<MetadataTable> list=new ArrayList<MetadataTable>();
    Set<MetadataTable> oldTables=((SelectorTableWizardPage)parentWizardPage).getOldTables();
    Set<MetadataTable> tables=ConnectionHelper.getTables(getConnection());
    if (oldTables != null && oldTables.size() > 0) {
      for (      MetadataTable table : tables) {
        boolean found=false;
        for (        MetadataTable oldtable : oldTables) {
          if (table != null && oldtable != null && table.getLabel().equals(oldtable.getLabel())) {
            found=true;
            break;
          }
        }
        if (table != null && !found) {
          list.add(table);
        }
      }
    }
 else {
      list.addAll(tables);
    }
    if (forTemplate || list.size() <= 0) {
      return true;
    }
  }
  return false;
}
Program: 128228
Project: 128228
Buggy source:
@Override protected IBeanPropertyAccessors<MetadataColumn,Integer> getLengthAccessor(){
  return new IBeanPropertyAccessors<MetadataColumn,Integer>(){
    public Integer get(    MetadataColumn bean){
      return Long.valueOf(bean.getLength()).intValue();
    }
    public void set(    MetadataColumn bean,    Integer value){
      if (value != null) {
        bean.setLength(value);
        if (Long.valueOf(bean.getOriginalLength()) == 0) {
          bean.setOriginalLength(value);
        }
      }
    }
  }
;
}

Fixed version (ground truth):
@Override protected IBeanPropertyAccessors<MetadataColumn,Integer> getLengthAccessor(){
  return new IBeanPropertyAccessors<MetadataColumn,Integer>(){
    public Integer get(    MetadataColumn bean){
      return Long.valueOf(bean.getLength()).intValue();
    }
    public void set(    MetadataColumn bean,    Integer value){
      if (value != null) {
        bean.setLength(value);
        if (Long.valueOf(bean.getOriginalLength()) == 0) {
          bean.setOriginalLength(value);
        }
      }
 else {
        bean.setLength(0);
      }
    }
  }
;
}
Program: 128229
Project: 128229
Buggy source:
@Override protected IBeanPropertyAccessors<MetadataColumn,Integer> getPrecisionAccessor(){
  return new IBeanPropertyAccessors<MetadataColumn,Integer>(){
    public Integer get(    MetadataColumn bean){
      return Long.valueOf(bean.getPrecision()).intValue();
    }
    public void set(    MetadataColumn bean,    Integer value){
      if (value != null) {
        bean.setPrecision(value);
      }
    }
  }
;
}

Fixed version (ground truth):
@Override protected IBeanPropertyAccessors<MetadataColumn,Integer> getPrecisionAccessor(){
  return new IBeanPropertyAccessors<MetadataColumn,Integer>(){
    public Integer get(    MetadataColumn bean){
      return Long.valueOf(bean.getPrecision()).intValue();
    }
    public void set(    MetadataColumn bean,    Integer value){
      if (value != null) {
        bean.setPrecision(value);
      }
 else {
        bean.setPrecision(0);
      }
    }
  }
;
}
Program: 128233
Project: 128233
Buggy source:
public static List<FOXTreeNode> getFoxTreeNodes(String filePath,String selectedEntity,boolean forMDM){
  if (selectedEntity == null || "String_Node_Str".equals(selectedEntity)) {
    return getFoxTreeNodes(filePath);
  }
 else {
    List<FOXTreeNode> list=new ArrayList<FOXTreeNode>();
    if (filePath == null) {
      return list;
    }
    List<String> attList=new ArrayList<String>();
    attList.add(selectedEntity);
    try {
      ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,forMDM,0,attList);
      ATreeNode selectedNode=null;
      if (treeNode != null) {
        if (forMDM) {
          if (selectedEntity.equals(treeNode.getValue())) {
            selectedNode=treeNode;
          }
        }
        for (        Object obj : treeNode.getChildren()) {
          if (obj instanceof ATreeNode) {
            ATreeNode node=(ATreeNode)obj;
            if (selectedEntity.equals(node.getValue())) {
              selectedNode=node;
              break;
            }
          }
        }
        if (selectedNode != null) {
          String rootName="String_Node_Str";
          if (treeNode.getValue() instanceof String) {
            rootName+="String_Node_Str" + treeNode.getValue();
          }
          FOXTreeNode root=cloneATreeNode(treeNode,rootName);
          if (root instanceof Element) {
            root.setParent(null);
            list.add(root);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
    return list;
  }
}

Fixed version (ground truth):
public static List<FOXTreeNode> getFoxTreeNodes(String filePath,String selectedEntity,boolean forMDM){
  if (selectedEntity == null || "String_Node_Str".equals(selectedEntity)) {
    return getFoxTreeNodes(filePath);
  }
 else {
    List<FOXTreeNode> list=new ArrayList<FOXTreeNode>();
    if (filePath == null) {
      return list;
    }
    List<String> attList=new ArrayList<String>();
    attList.add(selectedEntity);
    try {
      ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,forMDM,0,attList);
      ATreeNode selectedNode=null;
      if (treeNode != null) {
        if (forMDM) {
          if (selectedEntity.equals(treeNode.getValue())) {
            selectedNode=treeNode;
          }
        }
        for (        Object obj : treeNode.getChildren()) {
          if (obj instanceof ATreeNode) {
            ATreeNode node=(ATreeNode)obj;
            if (selectedEntity.equals(node.getValue())) {
              selectedNode=node;
              break;
            }
          }
        }
        if (selectedNode != null) {
          String rootName="String_Node_Str";
          if (treeNode.getValue() instanceof String) {
            rootName+="String_Node_Str" + treeNode.getValue();
          }
          FOXTreeNode root=cloneATreeNode(treeNode,rootName,XmlUtil.isXSDFile(filePath));
          if (root instanceof Element) {
            root.setParent(null);
            list.add(root);
          }
        }
      }
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
    return list;
  }
}
Program: 128234
Project: 128234
Buggy source:
private static void getFoxTreeNodesForXmlMap(String filePath,List<FOXTreeNode> list) throws OdaException, URISyntaxException, IOException {
  ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,0);
  String rootName="String_Node_Str";
  if (treeNode.getValue() instanceof String) {
    rootName+="String_Node_Str" + treeNode.getValue();
  }
  FOXTreeNode root=cloneATreeNode(treeNode,rootName);
  if (root instanceof Element) {
    if (root instanceof Element) {
      root=((Element)root).getElementChildren().get(0);
      root.setParent(null);
      list.add(root);
    }
  }
}

Fixed version (ground truth):
private static void getFoxTreeNodesForXmlMap(String filePath,List<FOXTreeNode> list) throws OdaException, URISyntaxException, IOException {
  ATreeNode treeNode=SchemaPopulationUtil.getSchemaTree(filePath,true,0);
  String rootName="String_Node_Str";
  if (treeNode.getValue() instanceof String) {
    rootName+="String_Node_Str" + treeNode.getValue();
  }
  FOXTreeNode root=cloneATreeNode(treeNode,rootName,XmlUtil.isXSDFile(filePath));
  if (root instanceof Element) {
    if (root instanceof Element) {
      root=((Element)root).getElementChildren().get(0);
      root.setParent(null);
      list.add(root);
    }
  }
}
Program: 128235
Project: 128235
Buggy source:
public Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}

Fixed version (ground truth):
public synchronized Property loadProperty(IResource iResource){
  URI propertyUri=URIHelper.convert(iResource.getFullPath());
  URI itemResourceURI=getItemResourceURI(propertyUri);
  List<Resource> resources=new ArrayList<Resource>(resourceSet.getResources());
  for (  Resource res : resources) {
    if (res != null) {
      if (propertyUri.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
      if (itemResourceURI.toString().equals(res.getURI().toString())) {
        res.unload();
        resourceSet.getResources().remove(res);
      }
    }
  }
  Resource propertyResource=resourceSet.getResource(propertyUri,true);
  Property property=(Property)EcoreUtil.getObjectByType(propertyResource.getContents(),PropertiesPackage.eINSTANCE.getProperty());
  return property;
}