Remove unneeded forEach from AttributesMap. (#3266)

This commit is contained in:
Anuraag Agrawal 2021-05-31 00:21:33 +09:00 committed by GitHub
parent ed99ea357f
commit 782e38fe6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 12 deletions

View File

@ -11,10 +11,8 @@ import io.opentelemetry.api.common.AttributesBuilder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
/** A map with a fixed capacity that drops attributes when the map gets full. */
@SuppressWarnings({"rawtypes", "unchecked"})
final class AttributesMap extends HashMap<AttributeKey<?>, Object> implements Attributes {
private static final long serialVersionUID = -5072696312123632376L;
@ -44,16 +42,6 @@ final class AttributesMap extends HashMap<AttributeKey<?>, Object> implements At
return (T) super.get(key);
}
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
public void forEach(BiConsumer<? super AttributeKey<?>, ? super Object> consumer) {
for (Map.Entry<AttributeKey<?>, Object> entry : entrySet()) {
AttributeKey key = entry.getKey();
Object value = entry.getValue();
consumer.accept((AttributeKey<?>) key, value);
}
}
@Override
public Map<AttributeKey<?>, Object> asMap() {
// Because Attributes is marked Immutable, IDEs may recognize this as redundant usage. However,