Skip to content
Draft
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
10 changes: 8 additions & 2 deletions internal-api/src/main/java/datadog/trace/api/TagMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public interface TagMap extends Map<String, Object>, Iterable<TagMap.EntryReader

/** Creates a new mutable TagMap that contains the contents of <code>map</code> */
static TagMap fromMap(Map<String, ?> map) {
TagMap tagMap = TagMap.create(map.size());
TagMap tagMap = TagMap.create();
tagMap.putAll(map);
return tagMap;
}
Expand All @@ -68,6 +68,12 @@ static TagMap create() {
return new OptimizedTagMap();
}

/**
* @deprecated {@code size} is ignored -- TagMap's storage can't honor a size hint without
* compromising its other optimizations, so this behaves identically to {@link #create()};
* prefer that. A dedicated sizing mechanism may be introduced separately.
*/
@Deprecated
static TagMap create(int size) {
return new OptimizedTagMap();
}
Expand Down Expand Up @@ -1114,7 +1120,7 @@ public Iterator<EntryChange> iterator() {
}

public TagMap build() {
TagMap map = TagMap.create(this.estimateSize());
TagMap map = TagMap.create();
fill(map);
return map;
}
Expand Down
Loading