opentracing / opentracing-java

OpenTracing API for Java. 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163
http://opentracing.io
Apache License 2.0
1.68k stars 344 forks source link

Allow injecting into maps of type Map<String,Object> #310

Closed tylerbenson closed 5 years ago

tylerbenson commented 5 years ago

For the inject case, it doesn’t matter so much that the generic type is declared as String.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+1.8%) to 75.897% when pulling 7e52811deb2ffe8b65374c3f4e9445c435c315e2 on tylerbenson:tyler/fix-generic-type into d6c6509d5524f99039e34cbf121df79c46a25147 on opentracing:v0.32.0.

yurishkuro commented 5 years ago

not sure I follow this change. It still refers to string, and string is not extensible: public final class String

carlosalberto commented 5 years ago

@yurishkuro If I'm correct, it allows a Map<String, Object> to be passed, so String objects are appended/set as values to the underlying map.

yurishkuro commented 5 years ago

we should have a test demonstrating that.

tylerbenson commented 5 years ago

@yurishkuro ok I modified the map in the test to use Object instead of String. Is that what you were asking for?

Ideally we could do something similar for TextMapExtractAdapter, but that's not quite as straightforward.

carlosalberto commented 5 years ago

@tylerbenson Thanks for the update

@yurishkuro Ok to merge this PR?