Fix block element equality#441
Merged
seratch merged 3 commits intoslackapi:masterfrom May 1, 2020
Merged
Conversation
@EqualsAndHashCode(callSuper = false) is already included in @DaTa
callSuper default to false
Codecov Report
@@ Coverage Diff @@
## master #441 +/- ##
============================================
+ Coverage 83.89% 83.95% +0.06%
- Complexity 2369 2370 +1
============================================
Files 250 250
Lines 6376 6376
Branches 578 578
============================================
+ Hits 5349 5353 +4
+ Misses 673 669 -4
Partials 354 354
Continue to review full report at Codecov.
|
Contributor
|
@eamelink Great catch! (yes, this is my fault...) Thank you very much for your contribution 🙇 |
Contributor
|
@eamelink I've overlooked this but having |
Merged
2 tasks
seratch
added a commit
that referenced
this pull request
May 2, 2020
Partially reverting #441 - get @EqualsAndHashCode(callSuper = false) back for data classes
seratch
added a commit
that referenced
this pull request
May 8, 2020
* [slack-api-client] #444 okhttp 4.4 -> 4.6 uprgrade (as it's highly recommended) - thanks @seratch * [slack-api-model] #441 #442 Fix Block Elements' object equality issues - thanks @eamelink * [slack-api-client] #445 #448 Add admin.usergroups.* API supports - thanks @seratch * [slack-api-model] #440 Add external data source supports for dialogs - thanks @favalos * [slack-api-model] #437 Update composition.OptionObject to have mrkdwn - thanks @seratch * [slack-api-model] Add teams[].team_url to admin.teams.list response - thanks @seratch * [slack-api-model] #449 Add attachement.author_id - thanks @seratch * [slack-app-backend] #446 Add channel_count to subteam_created / subteam_updated events - thanks @seratch * [slack-api-client etc] #444 #450 bump patch versions of AWS SDK, Micronaut, Jetty - thanks @seratch
emanguy
pushed a commit
to emanguy/java-slack-sdk
that referenced
this pull request
Jun 22, 2020
* [slack-api-client] slackapi#444 okhttp 4.4 -> 4.6 uprgrade (as it's highly recommended) - thanks @seratch * [slack-api-model] slackapi#441 slackapi#442 Fix Block Elements' object equality issues - thanks @eamelink * [slack-api-client] slackapi#445 slackapi#448 Add admin.usergroups.* API supports - thanks @seratch * [slack-api-model] slackapi#440 Add external data source supports for dialogs - thanks @favalos * [slack-api-model] slackapi#437 Update composition.OptionObject to have mrkdwn - thanks @seratch * [slack-api-model] Add teams[].team_url to admin.teams.list response - thanks @seratch * [slack-api-model] slackapi#449 Add attachement.author_id - thanks @seratch * [slack-app-backend] slackapi#446 Add channel_count to subteam_created / subteam_updated events - thanks @seratch * [slack-api-client etc] slackapi#444 slackapi#450 bump patch versions of AWS SDK, Micronaut, Jetty - thanks @seratch
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.
Summary
Block elements should be compared structurally, but their
@EqualsAndHashCodeannotation hadcallSuper = true. The super class however (typicallyButtonElement) doesn't haveequalsoverridden for structural equality. So two structurally identical elements would not be considered equal by.equals().In other words, this was failing:
The first commit in this PR fixes that, by removing the
callSuper = flagfrom the@EqualsAndHashCodeannotation, so that these elements are considered equals when they are structurally equivalent.Two additional commits that don't change anything, but just clean up a bit of code:
@EqualsAndHashCodewhen there's already@Data, which includes that.callSuper = falsefrom the remaining@EqualsAndHashCodeannotations, since it's the default value.Requirements (place an
xin each[ ])