Repository navigation
Remove filter bindings when SimpleFilterProvider.addFilter receives null - #6369
Conversation
|
I don't think this is right, see my comment on #6365. |
Updated addFilter methods to handle null filters by removing existing bindings.
|
Thanks for clarifying the intended behavior in #6365. I reworked this so both The tests now assert that existing and absent IDs have no mapping after null registration through either overload, then check default-filter fallback and unknown-ID handling after mapper construction. The constructor-map test that assumed explicit null bindings should be preserved was removed to match this scope. The two binding-removal tests fail against the previous implementation. The revised full build passes on Java 17 (Ubuntu and Windows), 21 and 25: https://github.com/wozhenbang2004/jackson-databind/actions/runs/41334351350 |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
Fixes #6365.
Both
addFilteroverloads now remove the binding when the filter isnull, so mapper construction does not encounter a null entry registered through this API. Their Javadocs document the removal behavior.Six regression tests cover removal of existing bindings and no-op removal of absent IDs through both overloads, call chaining, default-filter fallback after mapper construction, fail-on-unknown and ignore-unknown behavior, and a non-null filter control. The two binding-removal tests fail against the previous implementation.
The final full fork build passes on Java 17 (Ubuntu and Windows), 21 and 25. Java 17 reports 7,618 tests with no failures or errors.
Regression control: https://github.com/wozhenbang2004/jackson-databind/actions/runs/41334074184
Passing final build: https://github.com/wozhenbang2004/jackson-databind/actions/runs/41334351350