fix #1962 Avoid extending Entry in Context1#1963
Conversation
|
@simonbasle |
|
I don't think the |
|
actually @bsideup there is no real way around the stream conversion, because the operation is not symmetric. The |
Codecov Report
@@ Coverage Diff @@
## master #1963 +/- ##
============================================
+ Coverage 81.64% 81.66% +0.02%
+ Complexity 3982 3980 -2
============================================
Files 374 374
Lines 30811 30807 -4
Branches 5798 5798
============================================
+ Hits 25156 25160 +4
+ Misses 4060 4054 -6
+ Partials 1595 1593 -2
Continue to review full report at Codecov.
|
The motivation for this change is that this drives two implementations
of `Context#stream()` to use the `Context1` as an immutable map entry.
In turn, this proves problematic when the `stream()` is converted to a
string representation (eg. by loggers or assertions): the stream entries
use `Context1{k=v}` format, which is fine in a standalone toString but
less so in a representation of the whole stream.
AbstractMap.SimpleImmutableEntry can be leveraged instead, and has a
proper `key=value` string representation by default.
Also added tests around putAll-replaces case.
63d788b to
3821d25
Compare
|
since there is a doubt about #1964, this PR is now no more a duplicate. |
3821d25 to
4541db3
Compare
The motivation for this change is that this drives two implementations
of
Context#stream()to use theContext1as an immutable map entry.In turn, this proves problematic when the
stream()is converted to astring representation (eg. by loggers or assertions): the stream entries
use
Context1{k=v}format, which is fine in a standalone toString butless so in a representation of the whole stream.
AbstractMap.SimpleImmutableEntrycan be leveraged instead, and ithas a proper
key=valuestring representation by default.