bcoke-scottlogic commented on code in PR #8022:
URL: https://github.com/apache/gravitino/pull/8022#discussion_r2269170852
##########
api/src/main/java/org/apache/gravitino/stats/StatisticValues.java:
##########
@@ -291,7 +292,7 @@ public static class ObjectValue implements
StatisticValue<Map<String, StatisticV
private ObjectValue(Map<String, StatisticValue<?>> valueMap) {
Preconditions.checkArgument(
valueMap != null && !valueMap.isEmpty(), "Values cannot be null or
empty");
- this.valueMap = valueMap;
+ this.valueMap = new TreeMap<>(valueMap);
Review Comment:
The TreeMap is for sorting the passed in map, it shouldn't matter what kind
of map is passed in. Is the suggestion that if the passed map is already a
TreeMap we set valueMap without the TreeMap constructor? E.g.
```
if (valueMap instanceof TreeMap) {
this.valueMap = valueMap;
} else {
this.valueMap = new TreeMap<>(valueMap);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]