public EdmEntityContainer getEntityContainer(final String name) throws EdmException {
if (edmEntityContainers.containsKey(name)) {
return edmEntityContainers.get(name);
}
EdmEntityContainer edmEntityContainer = null;
try {
edmEntityContainer = createEntityContainer(name);
if (edmEntityContainer != null) {
if (name == null && edmEntityContainers.containsKey(edmEntityContainer.getName())) {
// ensure that the same default entity container is stored in the HashMap under null and its name
edmEntityContainer = edmEntityContainers.get(edmEntityContainer.getName());
edmEntityContainers.put(name, edmEntityContainer);
} else if (edmEntityContainers.containsKey(null) && edmEntityContainers.get(null) != null
&& name.equals(edmEntityContainers.get(null).getName())) {
// ensure that the same default entity container is stored in the HashMap under null and its name
edmEntityContainer = edmEntityContainers.get(null);