Alternate fix for
Turns out the issue wasn't with an empty string returning an empty array, but a string with just `,`.
```
jshell> ",".split(",")
$1 ==> String[0] {  }
```
A non-intuitive edge case in my opinion.
MODIFY
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/OpenTracing32.java
dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/OpenTracing32.java
@@ -299,12 +299,15 @@ public final class OpenTracing32 implements TracerAPI {
extracted = new HashMap<>();
for (final String key : getter.keys(carrier)) {
// extracted header value
- String s = getter.get(carrier, key);
+ String value = getter.get(carrier, key);
// in case of multiple values in the header, need to parse
- if (s != null && !s.isEmpty()) {
- s = s.split(",")[0].trim();
+ if (value != null) {
+ final String[] split = value.split(",");
+ if (split.length > 0) {
+ value = split[0].trim();
}
- extracted.put(key, s);
+ }
+ extracted.put(key, value);
}
}

Alternate fix for #1319

Turns out the issue wasn't with an empty string returning an empty array, but a string with just `,`.
```
jshell> ",".split(",")
$1 ==> String[0] {  }
```
A non-intuitive edge case in my opinion.