[212903] Ensure that delegateLastIndexOf is working properly.
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EClassImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EClassImpl.java
index 9912a0a..b763798 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EClassImpl.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EClassImpl.java
@@ -12,7 +12,7 @@
  *
  * </copyright>
  *
- * $Id: EClassImpl.java,v 1.41 2007/08/17 19:00:12 emerks Exp $
+ * $Id: EClassImpl.java,v 1.41.2.1 2007/12/14 23:03:42 emerks Exp $
  */
 
 package org.eclipse.emf.ecore.impl;
@@ -1657,9 +1657,9 @@
           protected int delegateLastIndexOf(Object object)
           {
             EList<EGenericType> eGenericSuperTypes = getEGenericSuperTypes();
-            for (int i = eGenericSuperTypes.size(); i > 0; --i)
+            for (int i = eGenericSuperTypes.size() - 1; i >= 0; --i)
             {
-              if (eGenericSuperTypes.get(i) == object)
+              if (unwrap(eGenericSuperTypes.get(i)) == object)
               {
                 return i;
               }
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EOperationImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
index 0778dfc..677a6d2 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EOperationImpl.java
@@ -12,7 +12,7 @@
  *
  * </copyright>
  *
- * $Id: EOperationImpl.java,v 1.19 2007/07/10 16:41:55 emerks Exp $
+ * $Id: EOperationImpl.java,v 1.19.2.1 2007/12/14 23:03:42 emerks Exp $
  */
 package org.eclipse.emf.ecore.impl;
 
@@ -338,9 +338,9 @@
           protected int delegateLastIndexOf(Object object)
           {
             EList<EGenericType> eGenericExceptions = getEGenericExceptions();
-            for (int i = eGenericExceptions.size(); i > 0; --i)
+            for (int i = eGenericExceptions.size() - 1; i >= 0; --i)
             {
-              if (eGenericExceptions.get(i) == object)
+              if (unwrap(eGenericExceptions.get(i)) == object)
               {
                 return i;
               }