garydgregory commented on code in PR #276:
URL: https://github.com/apache/commons-csv/pull/276#discussion_r1000733851


##########
src/main/java/org/apache/commons/csv/CSVFormat.java:
##########
@@ -356,11 +356,11 @@ public Builder setDelimiter(final String delimiter) {
         /**
          * Sets the duplicate header names behavior.
          *
-         * @param duplicateHeaderMode the duplicate header names behavior
+         * @param duplicateHeaderMode the duplicate header names behavior, may 
not be null
          * @return This instance.
          */
         public Builder setDuplicateHeaderMode(final DuplicateHeaderMode 
duplicateHeaderMode) {
-          this.duplicateHeaderMode = duplicateHeaderMode;
+          this.duplicateHeaderMode = 
Objects.requireNonNull(duplicateHeaderMode, "Mode required");

Review Comment:
   Why not use the `validate()` method like all other checks?



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