mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-17 15:35:46 +00:00
Last of the Checkstyle fixes.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1383758 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
57a1aef278
commit
5e7945e1ce
@ -182,18 +182,18 @@ public class CSVFormat implements Serializable {
|
||||
*/
|
||||
void validate() throws IllegalArgumentException {
|
||||
if (delimiter == encapsulator) {
|
||||
throw new IllegalArgumentException("The encapsulator character and the delimiter cannot be the same (\""
|
||||
+ encapsulator + "\")");
|
||||
throw new IllegalArgumentException("The encapsulator character and the delimiter cannot be the same (\"" +
|
||||
encapsulator + "\")");
|
||||
}
|
||||
|
||||
if (delimiter == escape) {
|
||||
throw new IllegalArgumentException("The escape character and the delimiter cannot be the same (\""
|
||||
+ escape + "\")");
|
||||
throw new IllegalArgumentException("The escape character and the delimiter cannot be the same (\"" +
|
||||
escape + "\")");
|
||||
}
|
||||
|
||||
if (delimiter == commentStart) {
|
||||
throw new IllegalArgumentException("The comment start character and the delimiter cannot be the same (\""
|
||||
+ commentStart + "\")");
|
||||
throw new IllegalArgumentException("The comment start character and the delimiter cannot be the same (\"" +
|
||||
commentStart + "\")");
|
||||
}
|
||||
|
||||
if (encapsulator != DISABLED && encapsulator == commentStart) {
|
||||
@ -202,8 +202,8 @@ public class CSVFormat implements Serializable {
|
||||
}
|
||||
|
||||
if (escape != DISABLED && escape == commentStart) {
|
||||
throw new IllegalArgumentException("The comment start and the escape character cannot be the same (\""
|
||||
+ commentStart + "\")");
|
||||
throw new IllegalArgumentException("The comment start and the escape character cannot be the same (\"" +
|
||||
commentStart + "\")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -216,15 +216,15 @@ class CSVLexer extends Lexer {
|
||||
return tkn;
|
||||
} else if (!isWhitespace(c)) {
|
||||
// error invalid char between token and next delimiter
|
||||
throw new IOException("(line " + getLineNumber()
|
||||
+ ") invalid char between encapsulated token and delimiter");
|
||||
throw new IOException("(line " + getLineNumber() +
|
||||
") invalid char between encapsulated token and delimiter");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (isEndOfFile(c)) {
|
||||
// error condition (end of file before end of token)
|
||||
throw new IOException("(startline " + startLineNumber
|
||||
+ ") EOF reached before encapsulated token finished");
|
||||
throw new IOException("(startline " + startLineNumber +
|
||||
") EOF reached before encapsulated token finished");
|
||||
} else {
|
||||
// consume character
|
||||
tkn.content.append((char) c);
|
||||
|
@ -183,8 +183,8 @@ public class CSVParser implements Iterable<CSVRecord> {
|
||||
} while (reusableToken.type == TOKEN);
|
||||
|
||||
if (!record.isEmpty()) {
|
||||
result = new CSVRecord(record.toArray(new String[record.size()]), headerMapping, sb == null ? null
|
||||
: sb.toString());
|
||||
final String comment = sb == null ? null : sb.toString();
|
||||
result = new CSVRecord(record.toArray(new String[record.size()]), headerMapping, comment);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user