Program: 129672
Project: 129672
Buggy source:
public XmlFileWizard(IWorkbench workbench,boolean creation,RepositoryNode node,String[] existingNames){
  super(workbench,creation);
  this.selection=selection;
  this.existingNames=existingNames;
  setNeedsProgressMonitor(true);
switch (node.getType()) {
case SIMPLE_FOLDER:
case REPOSITORY_ELEMENT:
    pathToSave=RepositoryNodeUtilities.getPath(node);
  break;
case SYSTEM_FOLDER:
pathToSave=new Path("String_Node_Str");
break;
}
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
connection=ConnectionFactory.eINSTANCE.createXmlFileConnection();
connection.setName(ERepositoryObjectType.METADATA_FILE_XML.getKey());
MetadataTable metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
metadataTable.setId(factory.getNextId());
RecordFile record=(RecordFile)ConnectionHelper.getPackage(connection.getName(),(Connection)connection,RecordFile.class);
if (record != null) {
PackageHelper.addMetadataTable(metadataTable,record);
}
 else {
RecordFile newrecord=RecordFactory.eINSTANCE.createRecordFile();
newrecord.setName(connection.getName());
ConnectionHelper.addPackage(newrecord,connection);
PackageHelper.addMetadataTable(metadataTable,newrecord);
}
connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
connectionProperty.setStatusCode("String_Node_Str");
connectionItem=PropertiesFactory.eINSTANCE.createXmlFileConnectionItem();
connectionItem.setProperty(connectionProperty);
connectionItem.setConnection(connection);
break;
case REPOSITORY_ELEMENT:
connection=(XmlFileConnection)((ConnectionItem)node.getObject().getProperty().getItem()).getConnection();
connectionProperty=node.getObject().getProperty();
connectionItem=(XmlFileConnectionItem)node.getObject().getProperty().getItem();
setRepositoryObject(node.getObject());
isRepositoryObjectEditable();
initLockStrategy();
break;
}
if (!creation) {
this.originaleObjectLabel=this.connectionItem.getProperty().getLabel();
this.originalVersion=this.connectionItem.getProperty().getVersion();
this.originalDescription=this.connectionItem.getProperty().getDescription();
this.originalPurpose=this.connectionItem.getProperty().getPurpose();
this.originalStatus=this.connectionItem.getProperty().getStatusCode();
}
}

Fixed version (ground truth):
public XmlFileWizard(IWorkbench workbench,boolean creation,RepositoryNode node,String[] existingNames){
  super(workbench,creation);
  this.selection=selection;
  this.existingNames=existingNames;
  setNeedsProgressMonitor(true);
switch (node.getType()) {
case SIMPLE_FOLDER:
case REPOSITORY_ELEMENT:
    pathToSave=RepositoryNodeUtilities.getPath(node);
  break;
case SYSTEM_FOLDER:
pathToSave=new Path("String_Node_Str");
break;
}
switch (node.getType()) {
case SIMPLE_FOLDER:
case SYSTEM_FOLDER:
connection=ConnectionFactory.eINSTANCE.createXmlFileConnection();
connection.setName(ERepositoryObjectType.METADATA_FILE_XML.getKey());
MetadataTable metadataTable=ConnectionFactory.eINSTANCE.createMetadataTable();
IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
metadataTable.setId(factory.getNextId());
RecordFile record=(RecordFile)ConnectionHelper.getPackage(connection.getName(),connection,RecordFile.class);
if (record != null) {
PackageHelper.addMetadataTable(metadataTable,record);
}
 else {
RecordFile newrecord=RecordFactory.eINSTANCE.createRecordFile();
newrecord.setName(connection.getName());
ConnectionHelper.addPackage(newrecord,connection);
PackageHelper.addMetadataTable(metadataTable,newrecord);
}
connectionProperty=PropertiesFactory.eINSTANCE.createProperty();
connectionProperty.setAuthor(((RepositoryContext)CoreRuntimePlugin.getInstance().getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
connectionProperty.setVersion(VersionUtils.DEFAULT_VERSION);
connectionProperty.setStatusCode("String_Node_Str");
connectionItem=PropertiesFactory.eINSTANCE.createXmlFileConnectionItem();
connectionItem.setProperty(connectionProperty);
connectionItem.setConnection(connection);
break;
case REPOSITORY_ELEMENT:
connection=(XmlFileConnection)((ConnectionItem)node.getObject().getProperty().getItem()).getConnection();
connectionProperty=node.getObject().getProperty();
connectionItem=(XmlFileConnectionItem)node.getObject().getProperty().getItem();
setRepositoryObject(node.getObject());
isRepositoryObjectEditable();
initLockStrategy();
break;
}
if (!creation) {
this.originaleObjectLabel=this.connectionItem.getProperty().getLabel();
this.originalVersion=this.connectionItem.getProperty().getVersion();
this.originalDescription=this.connectionItem.getProperty().getDescription();
this.originalPurpose=this.connectionItem.getProperty().getPurpose();
this.originalStatus=this.connectionItem.getProperty().getStatusCode();
}
}