This repository was archived by the owner on Dec 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
main/java/io/opencensus/trace
test/java/io/opencensus/trace
impl_core/src/main/java/io/opencensus/implcore/trace Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,9 @@ public void setStatus(Status status) {
9191
9292 /** No-op implementation of the {@link Span#end(EndSpanOptions)} method. */
9393 @ Override
94- public void end (EndSpanOptions options ) {}
94+ public void end (EndSpanOptions options ) {
95+ Utils .checkNotNull (options , "options" );
96+ }
9597
9698 @ Override
9799 public String toString () {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public class NoopSpan extends Span {
3030
3131 /** Creates a new {@code NoopSpan}. */
3232 public NoopSpan (SpanContext context , @ Nullable EnumSet <Options > options ) {
33- super (context , options );
33+ super (Utils . checkNotNull ( context , "context" ) , options );
3434 }
3535
3636 @ Override
@@ -63,5 +63,7 @@ public void addLink(Link link) {
6363 }
6464
6565 @ Override
66- public void end (EndSpanOptions options ) {}
66+ public void end (EndSpanOptions options ) {
67+ Utils .checkNotNull (options , "options" );
68+ }
6769}
Original file line number Diff line number Diff line change @@ -268,6 +268,8 @@ public SpanData toSpanData() {
268268
269269 @ Override
270270 public void putAttribute (String key , AttributeValue value ) {
271+ Preconditions .checkNotNull (key , "key" );
272+ Preconditions .checkNotNull (value , "value" );
271273 if (!getOptions ().contains (Options .RECORD_EVENTS )) {
272274 return ;
273275 }
@@ -381,6 +383,7 @@ public void setStatus(Status status) {
381383
382384 @ Override
383385 public void end (EndSpanOptions options ) {
386+ Preconditions .checkNotNull (options , "options" );
384387 if (!getOptions ().contains (Options .RECORD_EVENTS )) {
385388 return ;
386389 }
You can’t perform that action at this time.
0 commit comments