You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2012/10/11 16:29:13 UTC

svn commit: r1397077 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java

Author: ggregory
Date: Thu Oct 11 14:29:12 2012
New Revision: 1397077

URL: http://svn.apache.org/viewvc?rev=1397077&view=rev
Log:
Replace magic char with constant DOUBLE_QUOTE.

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?rev=1397077&r1=1397076&r2=1397077&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Thu Oct 11 14:29:12 2012
@@ -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 Serial
     public static final CSVFormat DEFAULT =
             PRISTINE.
             withDelimiter(COMMA)
-            .withEncapsulator('"')
+            .withEncapsulator(DOUBLE_QUOTE)
             .withEmptyLinesIgnored(true)
             .withLineSeparator(CRLF);
 
@@ -89,7 +91,7 @@ public class CSVFormat implements Serial
     public static final CSVFormat RFC4180 =
             PRISTINE.
             withDelimiter(COMMA)
-            .withEncapsulator('"')
+            .withEncapsulator(DOUBLE_QUOTE)
             .withLineSeparator(CRLF);
 
     /**
@@ -105,14 +107,14 @@ public class CSVFormat implements Serial
     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);