-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use equals() first for aggregate state check #2196
Merged
Merged
Conversation
This file contains 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
This avoids performing reflection on classes that may not be declared open to the module that contains the fixtures. Typically, these classes would implement a suitable equals method. This change will test equality using equals first, before attempting to check fields. If equals returns false, it will still check whether an equals method is explicitly implemented. Only when that is not the case, a field-to-field comparison is performed using the same approach for each individual field.
abuijze
added
Type: Enhancement
Use to signal an issue enhances an already existing feature of the project.
Priority 2: Should
High priority. Ideally, these issues are part of the release they’re assigned to.
labels
Apr 18, 2022
Instead of explicitlyUnequal(), check for null and whether either class has an equals method through or operations. As this is proceeded by Objects#equals, the scenario of (1) either being null or (2) either not having equals implemented points out equals failed and thus the state check should fail. Next to this, adjust indentation for clarity. #2196
Instead of explicitlyUnequal(), check for null and whether either class has an equals method through or operations. As this is proceeded by Objects#equals, the scenario of (1) either being null or (2) either not having equals implemented points out equals failed and thus the state check should fail. Next to this, adjust indentation for clarity. #2196
smcvb
approved these changes
Apr 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
smcvb
added
the
Status: In Progress
Use to signal this issue is actively worked on.
label
Apr 28, 2022
smcvb
added a commit
that referenced
this pull request
Apr 28, 2022
- Check if expected is null before creating the matcher - Expand description in case matching fails due to accessibility issues - Specify deprecation warning - Change complexity in assertThrows #2196
Kudos, SonarCloud Quality Gate passed! |
smcvb
added
Status: Resolved
Use to signal that work on this issue is done.
and removed
Status: In Progress
Use to signal this issue is actively worked on.
labels
Apr 29, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Priority 2: Should
High priority. Ideally, these issues are part of the release they’re assigned to.
Status: Resolved
Use to signal that work on this issue is done.
Type: Enhancement
Use to signal an issue enhances an already existing feature of the project.
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.
This avoids performing reflection on classes that may not be declared
open to the module that contains the fixtures. Typically, these classes
would implement a suitable equals method.
This change will test equality using equals first, before attempting to
check fields. If equals returns false, it will still check whether an
equals method is explicitly implemented. Only when that is not the case,
a field-to-field comparison is performed using the same approach for
each individual field.