Skip to content

Use Context.putAll(ContextView) rather than the deprecated variant #1041

@simonbasle

Description

@simonbasle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions