Skip to content

Conversation

@artembilan
Copy link
Member

Fixes #2873

Sometime it is important to map to most specific exception instead of
its super class.

  • Use LinkedHashMap for mapping keys in the
    ErrorMessageExceptionTypeRouter, as well as in its
    AbstractMappingMessageRouter superclass.
    Since we don't do that internal map modification, there is no reason to
    worry about concurrent access: we just replace an internal instance
    atomically with a new LinkedHashMap every time we modify a mapping
    for router

Cherry-pick to 5.1.x

Fixes spring-projects#2873

Sometime it is important to map to most specific exception instead of
its super class.

* Use `LinkedHashMap` for mapping keys in the
`ErrorMessageExceptionTypeRouter`, as well as in its
`AbstractMappingMessageRouter` superclass.
Since we don't do that internal map modification, there is no reason to
worry about concurrent access: we just replace an internal instance
atomically with a new `LinkedHashMap` every time we modify a mapping
for router

**Cherry-pick to 5.1.x**
* Polishing for `AbstractMappingMessageRouter` hierarchy, so we don't
use `protected channelMappings` field access any more
@artembilan
Copy link
Member Author

Should be OK now.
Thanks

@garyrussell garyrussell merged commit 23a73fa into spring-projects:master Apr 1, 2019
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.

Exception match order in ErrorMessageExceptionTypeRouter

2 participants