Remove unneeded forEach from AttributesMap. (#3266)
This commit is contained in:
parent
ed99ea357f
commit
782e38fe6e
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue