Skip to content

Commit

Permalink
Immutable values for AttributeValue arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
thisthat committed Feb 28, 2020
1 parent f31ec08 commit b3b4a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/main/java/io/opentelemetry/trace/AttributeValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static AttributeValue create(boolean... booleanValues) {
for (boolean value : booleanValues) {
values.add(value);
}
return new AutoValue_AttributeValue_AttributeValueBooleanArray(values);
return new AutoValue_AttributeValue_AttributeValueBooleanArray(Collections.unmodifiableList(values));
}

@Override
Expand All @@ -386,7 +386,7 @@ static AttributeValue create(long... longValues) {
for (long value : longValues) {
values.add(value);
}
return new AutoValue_AttributeValue_AttributeValueLongArray(values);
return new AutoValue_AttributeValue_AttributeValueLongArray(Collections.unmodifiableList(values));
}

@Override
Expand All @@ -413,7 +413,7 @@ static AttributeValue create(double... doubleValues) {
for (double value : doubleValues) {
values.add(value);
}
return new AutoValue_AttributeValue_AttributeValueDoubleArray(values);
return new AutoValue_AttributeValue_AttributeValueDoubleArray(Collections.unmodifiableList(values));
}

@Override
Expand Down

0 comments on commit b3b4a3e

Please sign in to comment.