commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1398349 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java
Date Mon, 15 Oct 2012 15:53:09 GMT
Author: sebb
Date: Mon Oct 15 15:53:09 2012
New Revision: 1398349

URL: http://svn.apache.org/viewvc?rev=1398349&view=rev
Log:
Now that delimiter is a char, simplify API by removing withDelimiter(Character)

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=1398349&r1=1398348&r2=1398349&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 Mon Oct 15
15:53:09 2012
@@ -171,7 +171,19 @@ public class CSVFormat implements Serial
      * @return true if <code>c</code> is a line break character
      */
     private static boolean isLineBreak(final Character c) {
-        return c != null && (c == LF || c == CR);
+        return c != null && isLineBreak(c.charValue());
+    }
+
+    /**
+     * Returns true if the given character is a line break character.
+     *
+     * @param c
+     *            the character to check
+     *
+     * @return true if <code>c</code> is a line break character
+     */
+    private static boolean isLineBreak(final char c) {
+        return c == LF || c == CR;
     }
 
     /**
@@ -226,19 +238,6 @@ public class CSVFormat implements Serial
      *             thrown if the specified character is a line break
      */
     public CSVFormat withDelimiter(final char delimiter) {
-        return withDelimiter(Character.valueOf(delimiter));
-    }
-
-    /**
-     * Returns a copy of this format using the specified delimiter character.
-     *
-     * @param delimiter
-     *            the delimiter character
-     * @return A copy of this format using the specified delimiter character
-     * @throws IllegalArgumentException
-     *             thrown if the specified character is a line break
-     */
-    public CSVFormat withDelimiter(final Character delimiter) {
         if (isLineBreak(delimiter)) {
             throw new IllegalArgumentException("The delimiter cannot be a line break");
         }



Mime
View raw message