Motivation
Reactor-Core 3.5.0 snapshots have started, in which some deprecated APIs are being removed.
One of these APIs is Context#putAll(Context).
Currently, rsocket-java makes use of this API in a single place which is enough to make it binary incompatible with reactor-core 3.5.0-SNAPSHOT. In turn, this prevents integration of that version of Reactor into Spring Framework 6.0.0 snapshots and milestones.
Releasing a patch version that explicitly ensures the ContextView variant is picked by the compiler would solve the issue and make rsocket-java 1.1.x compatible with both reactor-core 3.4.x and 3.5.x.
Desired solution
Make DISCARD_CONTEXT type ContextView rather than Context.
Considered alternatives
- explicitly cast
DISCARD_CONTEXT to ContextView when passing it to putAll
- use
DISCARD_CONTEXT.readOnly() to achieve the same