fbocse commented on a change in pull request #106: Deep copy maps and lists in 
GenericDataFile.
URL: https://github.com/apache/incubator-iceberg/pull/106#discussion_r257924593
 
 

 ##########
 File path: core/src/main/java/com/netflix/iceberg/GenericDataFile.java
 ##########
 @@ -405,4 +406,17 @@ public String toString() {
         .toString();
   }
 
+  private static <K, V> Map<K, V> copy(Map<K, V> map) {
+    if (map != null) {
+      return ImmutableMap.copyOf(map);
 
 Review comment:
   This will throw a NPE if the `map` parameter is a `HashMap` with null keys 
or values. Is that expected?
   Would this be considered overly defensive programming?
   ```
           map.values().removeIf(Objects::isNull);
           map.keySet().removeIf(Objects::isNull);
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to