rdblue commented on a change in pull request #198: [Baseline] Apply Baseline to 
iceberg-data #156
URL: https://github.com/apache/incubator-iceberg/pull/198#discussion_r291820017
 
 

 ##########
 File path: data/src/main/java/org/apache/iceberg/data/GenericRecord.java
 ##########
 @@ -104,7 +100,7 @@ public Object getField(String name) {
   @Override
   public void setField(String name, Object value) {
     Integer pos = nameToPos.get(name);
-    Preconditions.checkArgument(pos != null, "Cannot set unknown field named: 
" + name);
+    Preconditions.checkNotNull(pos, "Cannot set unknown field named: %s", 
name);
 
 Review comment:
   Actually, I think this should be `checkArgument`. The argument is invalid 
because `pos` is null, but the problem is that the name was not found, not that 
the name was null. So `NullPointerException` would be misleading because `name` 
may not be null to produce it.

----------------------------------------------------------------
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.
 
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