Program: 129994
Project: 129994
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(){
  boolean formIsPerformed=false;
  IWizardPage finalPage=getCurrentPage();
  if (finalPage == null) {
    finalPage=propertiesWizardPage;
  }
  deleteTemFile();
  if (connection.isInputModel()) {
    if (finalPage instanceof XmlFileWizardPage) {
      int step=((XmlFileWizardPage)finalPage).step;
      if (step == 2) {
        formIsPerformed=finalPage.isPageComplete();
        if (formIsPerformed) {
          List schemas=connection.getSchema();
          Set tables=ConnectionHelper.getTables(connection);
          if (!schemas.isEmpty() && !tables.isEmpty()) {
            XmlXPathLoopDescriptor currentSchema=(XmlXPathLoopDescriptor)schemas.get(0);
            MetadataTable currentTable=(MetadataTable)tables.toArray(new MetadataTable[0])[0];
            if (!currentSchema.getAbsoluteXPathQuery().equals(oldAbstractQueryPath)) {
              resetMetadata(currentSchema.getSchemaTargets(),true);
            }
 else {
              resetMetadata(currentSchema.getSchemaTargets(),false);
            }
          }
        }
      }
 else {
        formIsPerformed=finalPage.isPageComplete();
      }
    }
 else {
      formIsPerformed=finalPage.isPageComplete();
    }
  }
 else {
    formIsPerformed=finalPage.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        factory.create(connectionItem,propertiesWizardPage.getDestinationPath());
      }
 else {
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        factory.save(connectionItem);
        closeLockStrategy();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 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 false;
    }
    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.
 */
public boolean performFinish(){
  boolean formIsPerformed=false;
  IWizardPage finalPage=getCurrentPage();
  if (finalPage == null) {
    finalPage=propertiesWizardPage;
  }
  deleteTemFile();
  if (connection.isInputModel()) {
    if (finalPage instanceof XmlFileWizardPage) {
      int step=((XmlFileWizardPage)finalPage).step;
      if (step == 2) {
        formIsPerformed=finalPage.isPageComplete();
        if (formIsPerformed) {
          List schemas=connection.getSchema();
          Set tables=ConnectionHelper.getTables(connection);
          if (!schemas.isEmpty() && !tables.isEmpty()) {
            XmlXPathLoopDescriptor currentSchema=(XmlXPathLoopDescriptor)schemas.get(0);
            MetadataTable currentTable=(MetadataTable)tables.toArray(new MetadataTable[0])[0];
            if (!currentSchema.getAbsoluteXPathQuery().equals(oldAbstractQueryPath)) {
              resetMetadata(currentSchema.getSchemaTargets(),true);
            }
 else {
              resetMetadata(currentSchema.getSchemaTargets(),false);
            }
          }
        }
      }
 else {
        formIsPerformed=finalPage.isPageComplete();
      }
    }
 else {
      formIsPerformed=finalPage.isPageComplete();
    }
  }
 else {
    formIsPerformed=finalPage.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        factory.create(connectionItem,propertiesWizardPage.getDestinationPath());
      }
 else {
        Map<String,SchemaTarget> schemaTargetMap=new HashMap<String,SchemaTarget>();
        EList<XmlXPathLoopDescriptor> schema=connection.getSchema();
        if (schema != null && schema.size() > 0) {
          XmlXPathLoopDescriptor xmlXPathLoopDescriptor=schema.get(0);
          if (xmlXPathLoopDescriptor != null) {
            EList<SchemaTarget> schemaTargets=xmlXPathLoopDescriptor.getSchemaTargets();
            if (schemaTargets != null && schemaTargets.size() > 0) {
              for (              SchemaTarget schemaTarget : schemaTargets) {
                schemaTargetMap.put(schemaTarget.getTagName(),schemaTarget);
              }
            }
          }
        }
        MetadataTable[] tables=ConnectionHelper.getTables(connectionItem.getConnection()).toArray(new MetadataTable[0]);
        for (        MetadataTable table : tables) {
          EList<MetadataColumn> columns=table.getColumns();
          Iterator<MetadataColumn> columnsIter=columns.iterator();
          while (columnsIter.hasNext()) {
            MetadataColumn column=columnsIter.next();
            if (schemaTargetMap.size() > 0 && schemaTargetMap.get(column.getLabel()) == null) {
              columnsIter.remove();
            }
          }
        }
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        factory.save(connectionItem);
        closeLockStrategy();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 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 false;
    }
    return true;
  }
 else {
    return false;
  }
}