From cf1460b21e23a6681aa5222736fbfcd7481b1a0d Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Thu, 5 May 2016 19:55:37 +0000 Subject: [PATCH] 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 --- src/main/java/org/apache/commons/csv/CSVParser.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)); }