commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1397527 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
Date Fri, 12 Oct 2012 11:58:50 GMT
Author: ggregory
Date: Fri Oct 12 11:58:50 2012
New Revision: 1397527

URL: http://svn.apache.org/viewvc?rev=1397527&view=rev
Log:
Refactor magic strings into constants.

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=1397527&r1=1397526&r2=1397527&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 Fri Oct 12
11:58:50 2012
@@ -29,6 +29,10 @@ import java.io.StringWriter;
  */
 public class CSVFormat implements Serializable {
 
+    private static final String CR = "\n";
+
+    private static final char ESCAPE = '\\';
+
     private static final char TAB = '\t';
 
     private static final char DOUBLE_QUOTE = '"';
@@ -132,8 +136,8 @@ public class CSVFormat implements Serial
     public static final CSVFormat MYSQL =
             PRISTINE
             .withDelimiter(TAB)
-            .withEscape('\\')
-            .withLineSeparator("\n");
+            .withEscape(ESCAPE)
+            .withLineSeparator(CR);
 
     /**
      * Creates a customized CSV format.



Mime
View raw message