{
    boolean result = true;
    List<String> literals = new ArrayList<String>();
    EList<EEnumLiteral> eLiterals = eEnum.getELiterals();
    for (EEnumLiteral eEnumLiteral : eLiterals)
    {
      String literal = eEnumLiteral.getLiteral();
      if (literal != null)
      {
        int index = literals.indexOf(literal);
        if (index != -1)
        {
          if (diagnostics == null)
          {
            return false;
          }
          else
          {
            result = false;
            EEnumLiteral otherEEnumLiteral = eLiterals.get(index);
            // Don't complain about the literals if they are the same as the names and the names collide.
            //
            String name = eEnumLiteral.getName();
            if (name == null || !name.equals(literal) || !name.equals(otherEEnumLiteral.getName()))
            {
              diagnostics.add
                (createDiagnostic
                  (Diagnostic.ERROR,
                   DIAGNOSTIC_SOURCE,
                   UNIQUE_ENUMERATOR_LITERALS,
                   "_UI_EEnumUniqueEnumeratorLiterals_diagnostic", 
                   new Object[] { literal },
                   new Object[] { eEnum, eEnumLiteral, otherEEnumLiteral },
                   context));
            }
          }
        }
      }
      literals.add(literal);
    }
    return result;
  }