[581496] Register only the first EPackage against the resource URI
diff --git a/plugins/org.eclipse.emf.ecore.editor/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java b/plugins/org.eclipse.emf.ecore.editor/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java
index 0d1f919..e3fb7ff 100644
--- a/plugins/org.eclipse.emf.ecore.editor/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java
+++ b/plugins/org.eclipse.emf.ecore.editor/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java
@@ -2245,8 +2245,12 @@
Resource candidateResource = candidate.eResource();
if (candidateResource != null)
{
- packageRegistry.put(candidateResource.getURI().toString(), candidate);
- candidateResource.setURI(URI.createURI(candidateNsURI));
+ String uri = candidateResource.getURI().toString();
+ if (!packageRegistry.containsKey(uri))
+ {
+ packageRegistry.put(uri, candidate);
+ candidateResource.setURI(URI.createURI(candidateNsURI));
+ }
}
}
}