diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index ece275a4..5d8ffabe 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -403,8 +403,7 @@ public final class CSVParser implements Iterable, Closeable { final String header = headerRecord[i]; final boolean containsHeader = hdrMap.containsKey(header); final boolean emptyHeader = header == null || header.trim().isEmpty(); - if (containsHeader && - (!emptyHeader || (emptyHeader && !this.format.getAllowMissingColumnNames()))) { + if (containsHeader && (!emptyHeader || !this.format.getAllowMissingColumnNames())) { throw new IllegalArgumentException("The header contains a duplicate name: \"" + header + "\" in " + Arrays.toString(headerRecord)); }