Repository navigation
Make SinkEventAttributeSet.hashCode ignore resolveParent (#1075) - #1091
Merged
slachiewicz merged 1 commit intoSep 3, 2026
Merged
Conversation
Member
|
#1073 landed as e83c5a2 and moved both files this PR touches, so it now conflicts. The code is unchanged, only relocated:
The move was in flight when you opened this — apologies for the churn. This comment was created with AI assistance. |
tanvir-ux
force-pushed
the
fix-1075-hashcode-ignore-parent
branch
from
September 3, 2026 13:47
17ad8ce to
91bafc8
Compare
Contributor
Author
|
Rebased onto master after #1073. Same hashCode change, now in |
equals() already follows isEqual() and compares only own attributes. hashCode was folding in the resolve parent, so two equal sets could have different hash codes. Rebased onto master after apache#1073 moved these files into doxia-sink-api. Fixes apache#1075
slachiewicz
force-pushed
the
fix-1075-hashcode-ignore-parent
branch
from
September 3, 2026 14:53
91bafc8 to
8e33ffc
Compare
slachiewicz
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SinkEventAttributeSet.equals()already delegates toisEqual(), which compares only own attributes.hashCode()was adding the resolve parent, so two equal sets could have different hash codes.I dropped the parent from
hashCode()so it matches existing equality.getAttribute()still walks the parent. This is the least disruptive option from #1075. I did not change equals semantics.checkHashCodenow expectssetResolveParentnot to change the hash. I also added a contract test for two sets with the same own attributes and different parents.This is independent of #1073 (the class move). Happy to rebase if that lands first.
Fixes #1075
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
mvn -Prun-its verify).I ran
mvn -pl doxia-core -am test -Dtest=SinkEventAttributeSetTest -Dsurefire.failIfNoSpecifiedTests=falselocally (18 tests, green, including checkstyle/spotless/rat on those modules). I did not run-Prun-its.