Exemplo n.º 1
0
  /**
   * Basic equals method for LexNameTokens. This method does not handle type qualifiers in that case
   * use {@link HackLexNameToken}
   */
  @SuppressWarnings("javadoc")
  @Override
  public boolean equals(Object other) {
    if (!(other instanceof ILexNameToken)) {
      return false;
    }

    ILexNameToken lother = (ILexNameToken) other;

    if (typeQualifier != null && lother.getTypeQualifier() != null) {
      // For testing purpose the following line can be uncommented. The Type Checker is not supose
      // to rely on this
      // equal method but use the HelpLexNameToken class for that
      // throw new InternalException(-1, "Use HelpLexNameToken.isEqual to compare");

    } else if (typeQualifier != null && lother.getTypeQualifier() == null
        || typeQualifier == null && lother.getTypeQualifier() != null) {
      return false;
    }

    return matches(lother);
  }