Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java')
-rw-r--r--plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java38
1 files changed, 21 insertions, 17 deletions
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java
index 1f28e66e6..cf891c792 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EModelElementImpl.java
@@ -469,27 +469,31 @@ public abstract class EModelElementImpl extends MinimalEObjectImpl.Container imp
}
name = "%".equals(name) ? null : URI.decode(name);
-
- // Look for a matching named element.
- //
- for (Object object : eContents())
- {
- if (object instanceof ENamedElement)
- {
- ENamedElement eNamedElement = (ENamedElement)object;
- String otherName = eNamedElement.getName();
- if ((name == null ? otherName == null : name.equals(otherName)) && count-- == 0)
- {
- return eNamedElement;
- }
- }
- }
-
- return null;
+
+ return eObjectForURIFragmentNameSegment(name, count);
}
}
return super.eObjectForURIFragmentSegment(uriFragmentSegment);
}
+ EObject eObjectForURIFragmentNameSegment(String name, int count)
+ {
+ // Look for a matching named element.
+ //
+ for (Object object : eContents())
+ {
+ if (object instanceof ENamedElement)
+ {
+ ENamedElement eNamedElement = (ENamedElement)object;
+ String otherName = eNamedElement.getName();
+ if ((name == null ? otherName == null : name.equals(otherName)) && count-- == 0)
+ {
+ return eNamedElement;
+ }
+ }
+ }
+
+ return null;
+ }
}

Back to the top