[510914] isEqualArguments() throws indexOutOfBounds when checks
compatibility of List<IProject> and EJavaObject
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EClass.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EClass.java
index 26737cd..ddde351 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EClass.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EClass.java
@@ -427,7 +427,7 @@
    * This will be different from the {@link ETypedElement#getEGenericType feature's actual type} 
    * only if the {@link ETypedElement#getEGenericType feature's generic type} 
    * is specified using {@link EGenericType#getETypeParameter type parameters}.
-   * In that case, if the type parameter is bound to a more specific type in the {@link #getEAllGenericSuperTypes() super types}, that more specific type is sustituted.
+   * In that case, if the type parameter is bound to a more specific type in the {@link #getEAllGenericSuperTypes() super types}, that more specific type is substituted.
    * @return the generic type representing the effective type of the feature in the context of this specific class.
    * @since 2.9
    * <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EGenericTypeImpl.java b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EGenericTypeImpl.java
index 6158d71..7e43243 100644
--- a/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EGenericTypeImpl.java
+++ b/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/impl/EGenericTypeImpl.java
@@ -901,7 +901,7 @@
   {
     // Check any argument, if present, for compatibility.
     //
-    int size = instanceETypeArguments.size();
+    int size = Math.min(instanceETypeArguments.size(), eTypeArguments.size());
     if (size > 0)
     {
       for (int i = 0; i < size; ++i)
@@ -1034,12 +1034,7 @@
   {
     // Check all the arguments, if any, for equality.
     //
-    int size = instanceETypeArguments.size();
-    if (eTypeArguments.size() != size)
-    {
-      return false;
-    }
-    
+    int size = Math.min(instanceETypeArguments.size(), eTypeArguments.size());
     if (size != 0)
     {
       for (int i = 0; i < size; ++i)