Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Clarify that Tracer.extract can return null
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Biegan committed Oct 5, 2017
1 parent e000eb0 commit 0ff87b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions opentracing-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
<main.basedir>${project.basedir}/..</main.basedir>
<main.java.version>1.6</main.java.version>
<main.signature.artifact>java16</main.signature.artifact>
<findbugs.jsr305.version>3.0.2</findbugs.jsr305.version>
</properties>

<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
9 changes: 7 additions & 2 deletions opentracing-api/src/main/java/io/opentracing/Tracer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

import io.opentracing.propagation.Format;

import javax.annotation.Nullable;

/**
* Tracer is a simple, thin interface for Span creation and propagation across arbitrary transports.
*/
Expand Down Expand Up @@ -80,18 +82,21 @@ public interface Tracer extends ActiveSpanSource {
* </code></pre>
*
* If the span serialized state is invalid (corrupt, wrong version, etc) inside the carrier this will result in an
* IllegalArgumentException.
* IllegalArgumentException. If the span serialized state is missing the method returns null.
*
*
* @param <C> the carrier type, which also parametrizes the Format.
* @param format the Format of the carrier
* @param carrier the carrier for the SpanContext state. All Tracer.extract() implementations must support
* io.opentracing.propagation.TextMap and java.nio.ByteBuffer.
*
* @return the SpanContext instance holding context to create a Span.
* @return the SpanContext instance holding context to create a Span if carrier represents a SpanContext, null
* otherwise
*
* @see io.opentracing.propagation.Format
* @see io.opentracing.propagation.Format.Builtin
*/
@Nullable
<C> SpanContext extract(Format<C> format, C carrier);


Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<main.basedir>${project.basedir}</main.basedir>

<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
<junit.version>4.12</junit.version>
<assertj.version>3.8.0</assertj.version>
<mockito.version>1.10.19</mockito.version>
Expand Down Expand Up @@ -147,6 +148,12 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>${findbugs-jsr305.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down

0 comments on commit 0ff87b8

Please sign in to comment.