Skip to content

Commit 5b6b1fa

Browse files
committed
Refactor magic strings into constants.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397527 13f79535-47bb-0310-9956-ffa450edef68
1 parent af4a695 commit 5b6b1fa

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
*/
3030
public class CSVFormat implements Serializable {
3131

32+
private static final String CR = "\n";
33+
34+
private static final char ESCAPE = '\\';
35+
3236
private static final char TAB = '\t';
3337

3438
private static final char DOUBLE_QUOTE = '"';
@@ -132,8 +136,8 @@ public class CSVFormat implements Serializable {
132136
public static final CSVFormat MYSQL =
133137
PRISTINE
134138
.withDelimiter(TAB)
135-
.withEscape('\\')
136-
.withLineSeparator("\n");
139+
.withEscape(ESCAPE)
140+
.withLineSeparator(CR);
137141

138142
/**
139143
* Creates a customized CSV format.

0 commit comments

Comments
 (0)