-
Notifications
You must be signed in to change notification settings - Fork 95
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
TableViewer: fix calls to hashCode of DataSetsRow #343
Conversation
2b0e7b8
to
317a371
Compare
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, using identity based equalness should be good here with model being final and initialized with a new Instance for every TableViewer.
Codecov Report
@@ Coverage Diff @@
## master #343 +/- ##
==========================================
+ Coverage 51.77% 51.78% +0.01%
==========================================
Files 394 394
Lines 41214 41214
Branches 6623 6623
==========================================
+ Hits 21337 21344 +7
+ Misses 18364 18358 -6
+ Partials 1513 1512 -1
Continue to review full report at Codecov.
|
@dedeibel thanks for the PR! The identity-based comparison is also OK from my point of view. We are missing updated/custom N.B. as Obi-Wan once said: "Trust_the clang-formatter" ... and the QA checks for that matter. :-) Do you think you could upgrade the unit-test to improve the coverage also for this modified diff code? I am not only a fan of good unit-tests, but experience has shown that these make the code much more reliable as well as easier and more predictable to refactor or modify functionality. And as always, keep up the good work @dedeibel! |
fab8cfb
to
a309cd0
Compare
836130e
to
3f28225
Compare
3f28225
to
a8923d5
Compare
squashed based on earlier commit by @dedeibel
While working on a bugfix for the
TableViewer
I noticed a problem when theDataSetsRow
was added to a Hashing collection. (For example the result of afxRobot
lookup, resulting in a Set).The implementation of the
DataSetsRow
equals
/hashCode
seem to use to themodel
`sequals
/hashCode
which in turn uses the Lists default implementations. Those will in turn call it's children's methods, being theDataSetsRows
.Try using the original methods to see a stack overflow in the test case.
I am not sure about the best implementation of the
equals
/hashCode
methods in this case, please see it just as a suggestion.