From 9873b13df283ac65a37d56622bc1e01eca681611 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 28 Mar 2014 16:38:26 +0000 Subject: [PATCH] Don't omit default cases git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1582814 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/csv/CSVParser.java | 2 ++ src/main/java/org/apache/commons/csv/CSVPrinter.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 40655069..e1e3973c 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -449,6 +449,8 @@ public final class CSVParser implements Iterable, Closeable { sb.append(this.reusableToken.content); this.reusableToken.type = TOKEN; // Read another token break; + default: + throw new IllegalStateException("Unexpected Token type: " + this.reusableToken.type); } } while (this.reusableToken.type == TOKEN); diff --git a/src/main/java/org/apache/commons/csv/CSVPrinter.java b/src/main/java/org/apache/commons/csv/CSVPrinter.java index a8aa33ff..d30a052f 100644 --- a/src/main/java/org/apache/commons/csv/CSVPrinter.java +++ b/src/main/java/org/apache/commons/csv/CSVPrinter.java @@ -240,6 +240,8 @@ public final class CSVPrinter implements Flushable, Closeable { return; } break; + default: + throw new IllegalStateException("Unexpected Quote value: " + quotePolicy); } if (!quote) {