There are some implementations (I've observed) of OpenTracing that do not accept null arguments to SpanBuilder.asChildOf(). If tracer.extract() returns null (ie. no span context was passed to the servlet) and it is used to create a child span, .asChildOf() will cause a NullPointerException.
The equivalent operation would be to avoid calling .asChildOf() if extractedContext is null, which should work for any implementation.
There are some implementations (I've observed) of OpenTracing that do not accept null arguments to SpanBuilder.asChildOf(). If tracer.extract() returns null (ie. no span context was passed to the servlet) and it is used to create a child span, .asChildOf() will cause a NullPointerException.
The equivalent operation would be to avoid calling .asChildOf() if extractedContext is null, which should work for any implementation.