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
This commit is contained in:
Benedikt Ritter 2016-05-05 19:55:37 +00:00
parent 4901f1ccdc
commit cf1460b21e
1 changed files with 1 additions and 2 deletions

View File

@ -403,8 +403,7 @@ public final class CSVParser implements Iterable<CSVRecord>, 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));
}