Skip to content

Conversation

@fabriziodemaria
Copy link
Contributor

@fabriziodemaria fabriziodemaria commented Jul 25, 2025

Problem

The ImmutableContext class was accepting mutable maps in its constructor, allowing callers to modify the original map after instantiation, which would affect the "immutable" context. This violated the immutability guarantee and could lead to unexpected behavior.

Solution

Implemented comprehensive deep immutability through defensive copying at all levels

Related Issues

Fixes #150

Notes

This change is backwards compatible at the API level. However if an integration was performing collection mutation for collections used in a context object, the behavior might now change.

Signed-off-by: Fabrizio Demaria <[email protected]>
Signed-off-by: Fabrizio Demaria <[email protected]>
@nicklasl nicklasl merged commit 4ba03b8 into main Jul 29, 2025
6 checks passed
@nicklasl nicklasl deleted the immutable-context branch July 29, 2025 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setEvaluationContext does not support mutable maps well

4 participants