{
    List<EClass> superTypes = eClass.getESuperTypes();
    List<EStructuralFeature> result = null;
    boolean changeable = false;
    for (int i = 0, size = superTypes.size(); i < size; ++i) 
    {
      EClass eSuperType = superTypes.get(i);
      List<EStructuralFeature> allAttributes =  getAllAttributes(eSuperType);
      if (!allAttributes.isEmpty())
      {
        if (result == null)
        {
          result = allAttributes;
        }
        else
        {
          if (!changeable)
          {
            changeable = true;
            result = new UniqueEList<EStructuralFeature>(result);
          }
          result.addAll(allAttributes);
        }
      }
    }
    List<EStructuralFeature> attributes = getAttributes(eClass);
    if (!attributes.isEmpty())
    {
      if (result == null)
      {
        return attributes;
      }
      else
      {
        if (!changeable)
        {
          result = new UniqueEList<EStructuralFeature>(result);
        }
        result.addAll(attributes);
        return result;
      }
    }
    else
    {
      return result == null ? Collections.<EStructuralFeature>emptyList() : result;
    }
  }