aokolnychyi opened a new pull request, #9245: URL: https://github.com/apache/iceberg/pull/9245
The `equals` and `hashCode` behaviors contradict the `Set` API, which prohibits wrapping `CharSequenceSet` instances into unmodifiable wrappers in `CharSequenceMap$keySet`. ``` /** * Compares the specified object with this set for equality. Returns * {@code true} if the specified object is also a set, the two sets * have the same size, and every member of the specified set is * contained in this set (or equivalently, every member of this set is * contained in the specified set). This definition ensures that the * equals method works properly across different implementations of the * set interface. * * @param o object to be compared for equality with this set * @return {@code true} if the specified object is equal to this set */ boolean equals(Object o); /** * Returns the hash code value for this set. The hash code of a set is * defined to be the sum of the hash codes of the elements in the set, * where the hash code of a {@code null} element is defined to be zero. * This ensures that {@code s1.equals(s2)} implies that * {@code s1.hashCode()==s2.hashCode()} for any two sets {@code s1} * and {@code s2}, as required by the general contract of * {@link Object#hashCode}. * * @return the hash code value for this set * @see Object#equals(Object) * @see Set#equals(Object) */ int hashCode(); ``` This PR makes `CharSequenceSet` extend `AbstractSet` to inherit `equals` and changes `hashCode`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org