martin-g commented on code in PR #2738:
URL: https://github.com/apache/avro/pull/2738#discussion_r1490615146


##########
lang/java/avro/src/main/java/org/apache/avro/Schema.java:
##########
@@ -1497,7 +1497,7 @@ public Parser() {
     }
 
     public Parser(final NameValidator validate) {
-      this.validate = validate;
+      this.validate = Objects.requireNonNull(validate, "validate");

Review Comment:
   How about ?
   ```suggestion
         this.validate = validate != null ? validate : 
NameValidator.NO_VALIDATION);
   ```
   Schema.parse() uses `NameValidator.NO_VALIDATION` if there is no need to 
validate.
   I guess you use `Parser.parse()` directly and that's why you see NPEs later.



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

Reply via email to