From 13092bad7d2011b76f4a40e7baf8c4248e111139 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Thu, 11 Oct 2012 14:29:12 +0000 Subject: [PATCH] Replace magic char with constant DOUBLE_QUOTE. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397077 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/csv/CSVFormat.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index 8c78a430..35ce42d1 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -29,6 +29,8 @@ import java.io.StringWriter; */ public class CSVFormat implements Serializable { + private static final char DOUBLE_QUOTE = '"'; + private static final char COMMA = ','; private static final long serialVersionUID = 1L; @@ -73,7 +75,7 @@ public class CSVFormat implements Serializable { public static final CSVFormat DEFAULT = PRISTINE. withDelimiter(COMMA) - .withEncapsulator('"') + .withEncapsulator(DOUBLE_QUOTE) .withEmptyLinesIgnored(true) .withLineSeparator(CRLF); @@ -89,7 +91,7 @@ public class CSVFormat implements Serializable { public static final CSVFormat RFC4180 = PRISTINE. withDelimiter(COMMA) - .withEncapsulator('"') + .withEncapsulator(DOUBLE_QUOTE) .withLineSeparator(CRLF); /** @@ -105,14 +107,14 @@ public class CSVFormat implements Serializable { public static final CSVFormat EXCEL = PRISTINE .withDelimiter(COMMA) - .withEncapsulator('"') + .withEncapsulator(DOUBLE_QUOTE) .withLineSeparator(CRLF); /** Tab-delimited format, with quote; leading and trailing spaces ignored. */ public static final CSVFormat TDF = PRISTINE .withDelimiter('\t') - .withEncapsulator('"') + .withEncapsulator(DOUBLE_QUOTE) .withSurroundingSpacesIgnored(true) .withEmptyLinesIgnored(true) .withLineSeparator(CRLF);