Re: [PR] Fix equals() and hashCode() contract violat ion in XSSFColor [poi]
kali834x (via GitHub) <[email protected]> Mon, 29 Jun 2026 06:20:47 -0000
| Newsgroups | gmane.comp.jakarta.poi.devel |
|---|---|
| Message-ID | <PR_kwDOAAMmIM7p-waA-3c8894c7-bfb0-4530-a037-089475bc4224@gitbox.apache.org> |
kali834x commented on code in PR #1149:
URL: https://github.com/apache/poi/pull/1149#discussion_r3489672700
##########
poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java:
##########
@@ -382,7 +382,13 @@ public static XSSFColor toXSSFColor(Color color) {
@Override
public int hashCode() {
- return ctColor.toString().hashCode();
+ int result = 17;
+ result = 31 * result + (isAuto() ? 1 : 0);
Review Comment:
Done, switched it to Objects.hash. Tests still pass.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]