Validation checks the delimiter character cannot be null.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2012-10-13 17:38:39 +00:00
parent 0e7e9deabb
commit f342cb2caf
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,10 @@ public class CSVFormat implements Serializable {
* @throws IllegalStateException
*/
void validate() throws IllegalStateException {
if (delimiter == null) {
throw new IllegalStateException("The delimiter character cannot be null");
}
if (delimiter == encapsulator) {
throw new IllegalStateException("The encapsulator character and the delimiter cannot be the same ('" + encapsulator + "')");
}