Skip to content

Commit cf1460b

Browse files
committed
Simplify boolean expression: emptyHeader will always be true when reached.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1742466 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4901f1c commit cf1460b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/org/apache/commons/csv/CSVParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,7 @@ private Map<String, Integer> initializeHeader() throws IOException {
403403
final String header = headerRecord[i];
404404
final boolean containsHeader = hdrMap.containsKey(header);
405405
final boolean emptyHeader = header == null || header.trim().isEmpty();
406-
if (containsHeader &&
407-
(!emptyHeader || (emptyHeader && !this.format.getAllowMissingColumnNames()))) {
406+
if (containsHeader && (!emptyHeader || !this.format.getAllowMissingColumnNames())) {
408407
throw new IllegalArgumentException("The header contains a duplicate name: \"" + header +
409408
"\" in " + Arrays.toString(headerRecord));
410409
}

0 commit comments

Comments
 (0)