/** * Compares a DotName to another DotName and returns true if the represent * the same underlying semantic name. In other words, whether or not a * name is componentized or simple has no bearing on the comparison. * * @param o the DotName object to compare to * @return true if equal, false if not * * @see Object#equals(Object) */ public boolean equals(Object o) { if (this == o) return true; if (! (o instanceof DotName)) return false; DotName other = (DotName)o; if (other.prefix == null && prefix == null) return local.equals(other.local) && innerClass == other.innerClass; if (!other.componentized && componentized) return crossEquals(other, this); if (other.componentized && !componentized) return crossEquals(this, other); return prefix != null && innerClass == other.innerClass && local.equals(other.local) && prefix.equals(other.prefix); }