[517384] Using originalName annotations when looking up enum literals.
diff --git a/plugins/org.eclipse.uml2-feature/feature.xml b/plugins/org.eclipse.uml2-feature/feature.xml
index d058977..7aeb7d4 100644
--- a/plugins/org.eclipse.uml2-feature/feature.xml
+++ b/plugins/org.eclipse.uml2-feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.uml2"
       label="%feature.label"
-      version="5.2.3.qualifier"
+      version="5.2.4.qualifier"
       provider-name="%feature.provider-name"
       image="eclipse_update_120.jpg"
       license-feature="org.eclipse.uml2.license"
@@ -13,7 +13,7 @@
    </description>
 
    <copyright url="http://www.eclipse.org/legal/epl-v10.html">
-      Copyright (c) 2003, 2016 IBM Corporation, Embarcadero Technologies, CEA, and others.
+      Copyright (c) 2003, 2017 IBM Corporation, Embarcadero Technologies, CEA, and others.
 All rights reserved.   This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.uml2.sdk-feature/feature.xml b/plugins/org.eclipse.uml2.sdk-feature/feature.xml
index 22db9d4..1130330 100644
--- a/plugins/org.eclipse.uml2.sdk-feature/feature.xml
+++ b/plugins/org.eclipse.uml2.sdk-feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.uml2.sdk"
       label="%feature.label"
-      version="5.2.3.qualifier"
+      version="5.2.4.qualifier"
       provider-name="%feature.provider-name"
       image="eclipse_update_120.jpg"
       license-feature="org.eclipse.uml2.license"
@@ -13,7 +13,7 @@
    </description>
 
    <copyright url="http://www.eclipse.org/legal/epl-v10.html">
-      Copyright (c) 2003, 2016 IBM Corporation, Embarcadero Technologies, CEA, and others.
+      Copyright (c) 2003, 2017 IBM Corporation, Embarcadero Technologies, CEA, and others.
 All rights reserved.   This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.uml2.uml-feature/feature.xml b/plugins/org.eclipse.uml2.uml-feature/feature.xml
index a254178..5408d87 100644
--- a/plugins/org.eclipse.uml2.uml-feature/feature.xml
+++ b/plugins/org.eclipse.uml2.uml-feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.uml2.uml"
       label="%feature.label"
-      version="5.2.3.qualifier"
+      version="5.2.4.qualifier"
       provider-name="%feature.provider-name"
       image="eclipse_update_120.jpg"
       license-feature="org.eclipse.uml2.license"
diff --git a/plugins/org.eclipse.uml2.uml/META-INF/MANIFEST.MF b/plugins/org.eclipse.uml2.uml/META-INF/MANIFEST.MF
index e7f1c33..7627d70 100644
--- a/plugins/org.eclipse.uml2.uml/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.uml2.uml/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.uml2.uml; singleton:=true
-Bundle-Version: 5.2.3.qualifier
+Bundle-Version: 5.2.4.qualifier
 Bundle-ClassPath: .
 Bundle-Activator: org.eclipse.uml2.uml.UMLPlugin$Implementation
 Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java
index 1cb8ff1..4167295 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/internal/operations/ElementOperations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2016 IBM Corporation, Embarcadero Technologies, CEA, and others.
+ * Copyright (c) 2005, 2017 IBM Corporation, Embarcadero Technologies, CEA, and others.
  * All rights reserved.   This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
  *   Kenn Hussey (Embarcadero Technologie) - 247980
  *   Kenn Hussey - 323181, 418466
  *   Christian W. Damus (CEA) - 300957
- *   Kenn Hussey (CEA) - 485756
+ *   Kenn Hussey (CEA) - 485756, 517384
  */
 package org.eclipse.uml2.uml.internal.operations;
 
@@ -623,8 +623,8 @@
 
 							if (reference instanceof Enumeration) {
 								value = ((Enumeration) reference)
-									.getOwnedLiteral(
-										((EEnumLiteral) value).getName());
+									.getOwnedLiteral(UMLUtil.UML2EcoreConverter
+										.getOriginalName((EEnumLiteral) value));
 							}
 						}
 					}
diff --git a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
index 5583183..df77066 100644
--- a/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
+++ b/plugins/org.eclipse.uml2.uml/src/org/eclipse/uml2/uml/util/UMLUtil.java
@@ -10,7 +10,7 @@
  *   Kenn Hussey (Embarcadero Technologies) - 199624, 184249, 204406, 208125, 204200, 213218, 213903, 220669, 208016, 226396, 271470
  *   Nicolas Rouquette (JPL) - 260120, 313837
  *   Kenn Hussey - 286329, 313601, 314971, 344907, 236184, 335125
- *   Kenn Hussey (CEA) - 327039, 358792, 364419, 366350, 307343, 382637, 273949, 389542, 389495, 316165, 392833, 399544, 322715, 163556, 212765, 397324, 204658, 408612, 411731, 269598, 422000, 416833, 424568, 427167, 418466, 419324, 429994, 433157, 439915, 446388, 454864, 458906, 461374, 463066, 468230, 481712, 491587, 495564
+ *   Kenn Hussey (CEA) - 327039, 358792, 364419, 366350, 307343, 382637, 273949, 389542, 389495, 316165, 392833, 399544, 322715, 163556, 212765, 397324, 204658, 408612, 411731, 269598, 422000, 416833, 424568, 427167, 418466, 419324, 429994, 433157, 439915, 446388, 454864, 458906, 461374, 463066, 468230, 481712, 491587, 495564, 517384
  *   Yann Tanguy (CEA) - 350402
  *   Christian W. Damus (CEA) - 392833, 251963, 405061, 409396, 176998, 180744, 403374, 416833, 420338, 405065, 431342
  *   E.D.Willink - 420338
@@ -4361,7 +4361,11 @@
 				ecoreName = getValidJavaIdentifier(ecoreName);
 			}
 
-			if (!safeEquals(ecoreName, name)) {
+			if (!safeEquals(ecoreName, name)
+				&& isEmpty(EcoreUtil.getAnnotation(eNamedElement,
+					UML2_UML_PACKAGE_2_0_NS_URI,
+					ANNOTATION_DETAIL__ORIGINAL_NAME))) {
+
 				// record the original name, regardless whether it was converted
 				// by the camel-case names option or by munging to get a valid
 				// Java identifier, because clients such as OCL will require the
@@ -4411,9 +4415,11 @@
 
 			EAnnotation annotation = eNamedElement
 				.getEAnnotation(UML2_UML_PACKAGE_2_0_NS_URI);
+
 			if (annotation != null) {
-				String originalName = annotation.getDetails().get(
-					ANNOTATION_DETAIL__ORIGINAL_NAME);
+				String originalName = annotation.getDetails()
+					.get(ANNOTATION_DETAIL__ORIGINAL_NAME);
+
 				if (originalName != null) {
 					result = originalName;
 				}
@@ -6804,8 +6810,10 @@
 			}
 		}
 
-		protected void qualifyName(ENamedElement eNamedElement, String qualifier) {
-			String qualifiedName = qualifier + '_' + eNamedElement.getName();
+		protected void qualifyName(ENamedElement eNamedElement,
+				String qualifier) {
+			String name = eNamedElement.getName();
+			String qualifiedName = qualifier + '_' + name;
 
 			if (DEBUG) {
 				System.err.println("Qualified " //$NON-NLS-1$
@@ -6813,6 +6821,15 @@
 					+ qualifiedName);
 			}
 
+			if (isEmpty(EcoreUtil.getAnnotation(eNamedElement,
+				UML2_UML_PACKAGE_2_0_NS_URI,
+				ANNOTATION_DETAIL__ORIGINAL_NAME))) {
+
+				EcoreUtil.setAnnotation(eNamedElement,
+					UML2_UML_PACKAGE_2_0_NS_URI,
+					ANNOTATION_DETAIL__ORIGINAL_NAME, name);
+			}
+
 			eNamedElement.setName(qualifiedName);
 		}