Skip to content

Commit 85226d8

Browse files
committed
CSV-115: Simplify boolean expressions in CSVRecord. This also closes apache#1 from github. Thanks to Furkan Kamaci.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1592822 13f79535-47bb-0310-9956-ffa450edef68
1 parent a3260ed commit 85226d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public long getRecordNumber() {
136136
* @return true of this record is valid, false if not
137137
*/
138138
public boolean isConsistent() {
139-
return mapping == null ? true : mapping.size() == values.length;
139+
return mapping == null || mapping.size() == values.length;
140140
}
141141

142142
/**
@@ -147,7 +147,7 @@ public boolean isConsistent() {
147147
* @return whether a given column is mapped.
148148
*/
149149
public boolean isMapped(final String name) {
150-
return mapping != null ? mapping.containsKey(name) : false;
150+
return mapping != null && mapping.containsKey(name);
151151
}
152152

153153
/**

0 commit comments

Comments
 (0)