Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public AttributesBuilder toBuilder() {
return new ArrayBackedAttributesBuilder(new ArrayList<>(data()));
}

@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") // safe cast: values are stored internally keyed by AttributeKey<T>
@Override
@Nullable
public <T> T get(AttributeKey<T> key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ public <T> AttributesBuilder put(AttributeKey<T> key, @Nullable T value) {

@Override
@SuppressWarnings({"unchecked", "rawtypes"})
// Safe: Attributes guarantees iteration over matching AttributeKey<T> / value pairs.
public AttributesBuilder putAll(Attributes attributes) {
if (attributes == null) {
return this;
}
// Attributes must iterate over their entries with matching types for key / value, so this
// downcast to the raw type is safe.
attributes.forEach((key, value) -> put((AttributeKey) key, value));
return this;
}
Expand Down
Loading