Skip to content

Commit 97d59f8

Browse files
committed
Replace empty throws that "should not happen" with an IllegalStateException.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1383569 13f79535-47bb-0310-9956-ffa450edef68
1 parent cc4cc47 commit 97d59f8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,11 @@ public String format(String... values) {
431431
StringWriter out = new StringWriter();
432432
try {
433433
new CSVPrinter(out, this).println(values);
434+
return out.toString().trim();
434435
} catch (IOException e) {
435436
// should not happen
436-
}
437-
438-
return out.toString().trim();
437+
throw new IllegalStateException(e);
438+
}
439439
}
440440

441441
@Override

0 commit comments

Comments
 (0)