@Override
  public boolean equals(Object other) {
    if (!(other instanceof ImmutableCommonToken)) {
      return false;
    }
    ImmutableCommonToken otherToken = (ImmutableCommonToken) other;
    return type == otherToken.type &&
        ((text == null && otherToken.text == null) ||
          text != null && text.equals(otherToken.text));
  }
This class is designed to hold "constant" CommonTokens, that have fixed type
and text, and everything else equal to zero. They can therefore be reused
to save memory. However, to support reuse (canonicalization) we need to
implement the proper hashCode() and equals() methods.
parser/src/java/org/apache/hadoop/hive/ql/parse/ImmutableCommonToken.java