Allow subclassing SpanContext by other packages#1940
Allow subclassing SpanContext by other packages#1940tylerbenson wants to merge 1 commit intoopen-telemetry:masterfrom
Conversation
Having abstract methods with default visibility makes the class not able to be subclassed by other packages. Changing to protected to maintain the intended restrictions from open-telemetry#1594, but allowing it to be subclassed.
Codecov Report
@@ Coverage Diff @@
## master #1940 +/- ##
============================================
+ Coverage 86.63% 86.67% +0.04%
- Complexity 1501 1502 +1
============================================
Files 184 184
Lines 5662 5664 +2
Branches 582 582
============================================
+ Hits 4905 4909 +4
+ Misses 551 550 -1
+ Partials 206 205 -1
Continue to review full report at Codecov.
|
|
Why do you need to create a non-AutoValue subclass of SpanContext? I think this is probably not a good idea, since we do not want the SpanContext to end up mutable. If we allow subclassing, we cannot guarantee that. Is there another way to solve your use-case that doesn't open up the possibility of breaking things? |
|
@tylerbenson The spec says that the SpanContext functionality SHOULD NOT be overridable, so I don't think we should do that. |
|
Closing in favor of #1935. |
Having abstract methods with default visibility makes the class not able to be subclassed by other packages.
Changing to protected to maintain the intended restrictions from #1594, but allowing it to be subclassed.