Skip to content

Commit

Permalink
PR feedback, test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Aug 24, 2023
1 parent 188171c commit 0ab8496
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public io.opentelemetry.api.common.Attributes create(
throw new ConfigurationException(
"Error processing attribute with key \"" + key + "\": unexpected null value");
}
Class<?> valueClass = value.getClass();
if (value instanceof String) {
builder.put(key, (String) value);
return;
Expand All @@ -73,7 +72,7 @@ public io.opentelemetry.api.common.Attributes create(
builder.put(key, (boolean) value);
return;
}
if (List.class.isAssignableFrom(valueClass)) {
if (value instanceof List) {
List<?> values = (List<?>) value;
if (values.isEmpty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ void create() {
.withAdditionalProperty("intArrKey", Arrays.asList(1, 2))
.withAdditionalProperty("doubleArrKey", Arrays.asList(1.0d, 2.0d))
.withAdditionalProperty("floatArrKey", Arrays.asList(1.0f, 2.0f))
.withAdditionalProperty("boolArrKey", Arrays.asList(true, false)),
.withAdditionalProperty("boolArrKey", Arrays.asList(true, false))
.withAdditionalProperty("emptyArrKey", Collections.emptyList()),
mock(SpiHelper.class),
Collections.emptyList()))
.isEqualTo(
Expand Down

0 comments on commit 0ab8496

Please sign in to comment.