From da88de93dfa07af7d42b1ea607292af27769a2d9 Mon Sep 17 00:00:00 2001 From: Harshitha Sudhakar <111514477+harshithasudhakar@users.noreply.github.com> Date: Wed, 5 Apr 2023 15:35:39 +0530 Subject: [PATCH 1/5] Update Trace.java Included "Object.requireNonNull()" --- .../main/java/org/apache/eventmesh/runtime/trace/Trace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java index cefe5da264..ce786f8a39 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java @@ -120,7 +120,7 @@ public Span addTraceInfoToSpan(ChannelHandlerContext ctx, CloudEvent cloudEvent) //add trace info for (String entry : cloudEvent.getExtensionNames()) { - span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : cloudEvent.getExtension(entry).toString()); + span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Object.requireNonNull(cloudEvent.getExtension(entry)).toString()); } return span; } @@ -140,7 +140,7 @@ public Span addTraceInfoToSpan(Span span, CloudEvent cloudEvent) { } for (String entry : cloudEvent.getExtensionNames()) { - span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : cloudEvent.getExtension(entry).toString()); + span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Object.requireNonNull(cloudEvent.getExtension(entry)).toString()); } return span; } From 1f8013e60f7d1496f85b05e846cf6ec89b8ba87c Mon Sep 17 00:00:00 2001 From: Harshitha Sudhakar <111514477+harshithasudhakar@users.noreply.github.com> Date: Thu, 6 Apr 2023 21:17:55 +0530 Subject: [PATCH 2/5] Update Trace.java --- .../src/main/java/org/apache/eventmesh/runtime/trace/Trace.java | 1 + 1 file changed, 1 insertion(+) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java index ce786f8a39..dc9b08edbb 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java @@ -24,6 +24,7 @@ import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.Objects; import io.cloudevents.CloudEvent; import io.netty.channel.ChannelHandlerContext; From afcd2ebda7d7b631aae5d62816f2678a66d89eb3 Mon Sep 17 00:00:00 2001 From: Harshitha Sudhakar <111514477+harshithasudhakar@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:23:26 +0530 Subject: [PATCH 3/5] Update Trace.java --- .../main/java/org/apache/eventmesh/runtime/trace/Trace.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java index dc9b08edbb..731443086a 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java @@ -121,7 +121,7 @@ public Span addTraceInfoToSpan(ChannelHandlerContext ctx, CloudEvent cloudEvent) //add trace info for (String entry : cloudEvent.getExtensionNames()) { - span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Object.requireNonNull(cloudEvent.getExtension(entry)).toString()); + span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Objects.requireNonNull(cloudEvent.getExtension(entry)).toString()); } return span; } @@ -141,7 +141,7 @@ public Span addTraceInfoToSpan(Span span, CloudEvent cloudEvent) { } for (String entry : cloudEvent.getExtensionNames()) { - span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Object.requireNonNull(cloudEvent.getExtension(entry)).toString()); + span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Objects.requireNonNull(cloudEvent.getExtension(entry)).toString()); } return span; } From efb436ee16b5eec10e00de4402c948bd81a21890 Mon Sep 17 00:00:00 2001 From: Harshitha Sudhakar <111514477+harshithasudhakar@users.noreply.github.com> Date: Fri, 14 Apr 2023 09:07:08 +0530 Subject: [PATCH 4/5] Update Trace.java --- .../src/main/java/org/apache/eventmesh/runtime/trace/Trace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java index 731443086a..d2c4e77537 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java @@ -22,9 +22,9 @@ import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.Objects; import io.cloudevents.CloudEvent; import io.netty.channel.ChannelHandlerContext; From d4b209b5789ea759f3ec708b9f9da198806b46df Mon Sep 17 00:00:00 2001 From: Harshitha Sudhakar <111514477+harshithasudhakar@users.noreply.github.com> Date: Fri, 19 May 2023 23:35:54 +0530 Subject: [PATCH 5/5] Update Trace.java --- .../src/main/java/org/apache/eventmesh/runtime/trace/Trace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java index d2c4e77537..944077b40c 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/trace/Trace.java @@ -141,7 +141,7 @@ public Span addTraceInfoToSpan(Span span, CloudEvent cloudEvent) { } for (String entry : cloudEvent.getExtensionNames()) { - span.setAttribute(entry, cloudEvent.getExtension(entry) == null ? "" : Objects.requireNonNull(cloudEvent.getExtension(entry)).toString()); + span.setAttribute(entry, cloudEvent.getExtension(entry) != null ? cloudEvent.getExtension(entry).toString() : ""); } return span; }