Fix a potential problem in JavaTimeModule._findFactory()#381
Fix a potential problem in JavaTimeModule._findFactory()#381cowtowncoder merged 2 commits intoFasterXML:2.xfrom
JavaTimeModule._findFactory()#381Conversation
Validate the order of the argument types against the order of the parameters. The previous version ignored mismatches and returned the first method with the correct name and correct number of parameters regardless of parameter types.
|
First of all, thank you for contributing this fix! Second: one (and only) process thing we have is that we need CLA from: https://github.com/FasterXML/jackson/blob/main/contributor-agreement.pdf before the first PR (but only needs to be sent once, good for all future contributions). Third: is there specific problem case this solves? If so, would it be possible to add a unit test to guard against regression? |
|
The contributor agreement is on its way.
I did not run into a specific issue with the code, I discovered the issue while looking through the Unfortunately the I can write tests for the |
|
@AlbertLovers Ah ok. Looking at code it's called just once,a s for Given this, I think it's ok not to write mock-based test; some indirect testing probably exists wrt deserialization of JDK Fix itself makes sense. |
JavaTimeModule._findFactory()
|
Actually... no, looks like this code never gets executed. Oh well. Even less point in writing mock tests. |
Validate the order of the argument types against the order of the parameters. The previous version ignored mismatches and returned the first method with the correct name and correct number of parameters regardless of parameter types.