Allow ComparingNormalizedFields instances to be reused across different assertions#3493
Allow ComparingNormalizedFields instances to be reused across different assertions#3493genuss wants to merge 1 commit intoassertj:mainfrom
ComparingNormalizedFields instances to be reused across different assertions#3493Conversation
b087207 to
309c62c
Compare
|
Thanks for reporting it and providing a fix, @genuss! We'll check it and get back to you. |
|
thanks @genuss, I'll look at it next week |
|
I had a quick look and there was indeed a bug in The code is a bit crap because I have a fix but it needs a bit more love and I'll see if I want to cache |
|
Integrated thanks @genuss ! |
|
Very good, thank you too! |
ComparingNormalizedFields instances to be reused across different assertions
Hi, team!
After upgrading to 3.25.3 I see that
ComparingNormalizedFieldsRecursiveComparisonIntrospectionStrategycan't be between different assertions (see my example). I digged into the code and found that the change was introduced in commit 0d5b789, related to some performance improvements. The root cause is thatoriginalFieldNamesByNormalizedFieldNameByNodeis an identity hash map, althoughfieldNamesPerClassis keyed by class values. So, I found a fix for that, which I present here. I'm not sure that it's 100% correct, but I didn't find any failing tests. Hope you may find this helpful.Check List: