Skip to content

Commit

Permalink
fix test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Jul 17, 2023
1 parent 638b1ad commit 7bf01c1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class FieldMemoryStats implements Writeable, Iterable<Map.Entry<Str
*/
public FieldMemoryStats(Map<String, Long> stats) {
this.stats = Objects.requireNonNull(stats, "status must be non-null");
assert !stats.containsKey(null);
assert stats.containsKey(null) == false;
}

/**
Expand Down Expand Up @@ -128,7 +128,7 @@ public Iterator<Map.Entry<String, Long>> iterator() {
* Returns the fields value in bytes or <code>0</code> if it's not present in the stats
*/
public long get(String field) {
return stats.get(field);
return stats.getOrDefault(field, 0L);
}

/**
Expand Down

0 comments on commit 7bf01c1

Please sign in to comment.