Program: 123369
Project: 123369
Buggy source:
@Override public void doRun(){
  if (this.repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  if (isToolbar()) {
    if (repositoryNode != null && repositoryNode.getContentType() != ERepositoryObjectType.METADATA_CONNECTIONS) {
      repositoryNode=null;
    }
    if (repositoryNode == null) {
      repositoryNode=getRepositoryNodeForDefault(ERepositoryObjectType.METADATA_CONNECTIONS);
    }
  }
  RepositoryManager.getRepositoryView().refresh();
  RepositoryNode metadataNode=repositoryNode.getParent();
  if (metadataNode != null) {
    getViewPart().setFocus();
    getViewPart().expand(metadataNode,true);
    getViewPart().expand(repositoryNode,true);
  }
  DatabaseConnection connection=null;
  IPath pathToSave=null;
  if (repositoryNode.getObject() != null && repositoryNode.getObject().getClass().equals(RepositoryObject.class)) {
    try {
      ((RepositoryObject)repositoryNode.getObject()).setProperty(ProxyRepositoryFactory.getInstance().getUptodateProperty(repositoryNode.getObject().getProperty()));
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  RepositoryNode node=repositoryNode;
  boolean creation=false;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    connection=(DatabaseConnection)((ConnectionItem)node.getObject().getProperty().getItem()).getConnection();
  creation=false;
break;
case SIMPLE_FOLDER:
pathToSave=RepositoryNodeUtilities.getPath(node);
connection=ConnectionFactory.eINSTANCE.createDatabaseConnection();
creation=true;
break;
case SYSTEM_FOLDER:
pathToSave=new Path("String_Node_Str");
connection=ConnectionFactory.eINSTANCE.createDatabaseConnection();
creation=true;
break;
}
if (!creation) {
Property property=node.getObject().getProperty();
Property updatedProperty=null;
if (getNeededVersion() == null) {
}
 else {
try {
updatedProperty=ProxyRepositoryFactory.getInstance().getUptodateProperty(new Project(ProjectManager.getInstance().getProject(property.getItem())),property);
}
 catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
DatabaseWizard databaseWizard;
if (isToolbar()) {
databaseWizard=new DatabaseWizard(PlatformUI.getWorkbench(),creation,node,getExistingNames());
databaseWizard.setToolBar(true);
}
 else {
databaseWizard=new DatabaseWizard(PlatformUI.getWorkbench(),creation,node,getExistingNames());
}
if (!creation) {
RepositoryManager.refreshSavedNode(node);
}
WizardDialog wizardDialog=new WizardDialog(Display.getCurrent().getActiveShell(),databaseWizard);
wizardDialog.setPageSize(600,540);
wizardDialog.create();
wizardDialog.open();
connItem=databaseWizard.getConnectionItem();
RepositoryManager.refreshSavedNode(node);
}

Fixed version (ground truth):
@Override public void doRun(){
  if (this.repositoryNode == null) {
    repositoryNode=getCurrentRepositoryNode();
  }
  if (isToolbar()) {
    if (repositoryNode != null && repositoryNode.getContentType() != ERepositoryObjectType.METADATA_CONNECTIONS) {
      repositoryNode=null;
    }
    if (repositoryNode == null) {
      repositoryNode=getRepositoryNodeForDefault(ERepositoryObjectType.METADATA_CONNECTIONS);
    }
  }
  RepositoryNode metadataNode=repositoryNode.getParent();
  if (metadataNode != null) {
    getViewPart().setFocus();
    getViewPart().expand(metadataNode,true);
    getViewPart().expand(repositoryNode,true);
  }
  DatabaseConnection connection=null;
  IPath pathToSave=null;
  if (repositoryNode.getObject() != null && repositoryNode.getObject().getClass().equals(RepositoryObject.class)) {
    try {
      ((RepositoryObject)repositoryNode.getObject()).setProperty(ProxyRepositoryFactory.getInstance().getUptodateProperty(repositoryNode.getObject().getProperty()));
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  RepositoryNode node=repositoryNode;
  boolean creation=false;
switch (node.getType()) {
case REPOSITORY_ELEMENT:
    connection=(DatabaseConnection)((ConnectionItem)node.getObject().getProperty().getItem()).getConnection();
  creation=false;
break;
case SIMPLE_FOLDER:
pathToSave=RepositoryNodeUtilities.getPath(node);
connection=ConnectionFactory.eINSTANCE.createDatabaseConnection();
creation=true;
break;
case SYSTEM_FOLDER:
pathToSave=new Path("String_Node_Str");
connection=ConnectionFactory.eINSTANCE.createDatabaseConnection();
creation=true;
break;
}
if (!creation) {
RepositoryManager.refreshSavedNode(repositoryNode);
Property property=node.getObject().getProperty();
Property updatedProperty=null;
if (getNeededVersion() == null) {
}
 else {
try {
updatedProperty=ProxyRepositoryFactory.getInstance().getUptodateProperty(new Project(ProjectManager.getInstance().getProject(property.getItem())),property);
}
 catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
}
DatabaseWizard databaseWizard;
if (isToolbar()) {
databaseWizard=new DatabaseWizard(PlatformUI.getWorkbench(),creation,node,getExistingNames());
databaseWizard.setToolBar(true);
}
 else {
databaseWizard=new DatabaseWizard(PlatformUI.getWorkbench(),creation,node,getExistingNames());
}
if (!creation) {
RepositoryManager.refreshSavedNode(node);
}
WizardDialog wizardDialog=new WizardDialog(Display.getCurrent().getActiveShell(),databaseWizard);
wizardDialog.setPageSize(600,540);
wizardDialog.create();
wizardDialog.open();
connItem=databaseWizard.getConnectionItem();
RepositoryManager.refreshSavedNode(node);
}