Skip to content

Commit

Permalink
Tags no longer explicitly return a SortedSet/Map (callers should use …
Browse files Browse the repository at this point in the history
…<? extends Set/Map>)

RELNOTES=Tags no longer explicitly return a SortedSet/Map (callers should use <? extends Set/Map>)
PiperOrigin-RevId: 336709518
  • Loading branch information
hagbard authored and Flogger Team committed Oct 12, 2020
1 parent 95ded18 commit b849fa9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.logging.Level;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;

Expand Down Expand Up @@ -268,7 +267,7 @@ private static <T> void castAndEmit(MetadataKey<T> key, Object value, KeyValueFo

/** Emits all the key/value pairs of this Tags instance to the given consumer. */
private static void emitAllTags(Tags tags, KeyValueFormatter out) {
for (Map.Entry<String, SortedSet<Object>> e : tags.asMap().entrySet()) {
for (Map.Entry<String, ? extends Set<Object>> e : tags.asMap().entrySet()) {
// Remember that tags can exist without values.
String key = e.getKey();
Set<Object> values = e.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ private Tags(SortedMap<String, SortedSet<Object>> map) {
}

/** Returns an immutable map containing the tag values. */
public SortedMap<String, SortedSet<Object>> asMap() {
public Map<String, ? extends Set<Object>> asMap() {
return map;
}

Expand Down

0 comments on commit b849fa9

Please sign in to comment.