commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r612746 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
Date Thu, 17 Jan 2008 12:14:57 GMT
On 17/01/2008, ggregory@apache.org <ggregory@apache.org> wrote:
> Author: ggregory
> Date: Wed Jan 16 23:54:21 2008
> New Revision: 612746
>
> URL: http://svn.apache.org/viewvc?rev=612746&view=rev
> Log:
> Remove dependency on Java 1.4.2. Stick with Java 1.3.1.
>
> Modified:
>    commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
>
> Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
> URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java?rev=612746&r1=612745&r2=612746&view=diff
> ==============================================================================
> --- commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
(original)
> +++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
Wed Jan 16 23:54:21 2008
> @@ -42,6 +42,7 @@
>
>     private static final char CSV_DELIMITER = ',';
>     private static final char CSV_QUOTE = '"';
> +    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);
>     private static final char[] CSV_SEARCH_CHARS = new char[] {CSV_DELIMITER, CSV_QUOTE,
CharUtils.CR, CharUtils.LF};
>
>     /**
> @@ -850,7 +851,7 @@
>
>         if ( StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS) ) {
>             // deal with escaped quotes; ie) ""
> -            str = StringUtils.replace(quoteless, "" + CSV_QUOTE + CSV_QUOTE, Character.toString(CSV_QUOTE));
> +            str = StringUtils.replace(quoteless, "" + CSV_QUOTE + CSV_QUOTE, CSV_QUOTE_STR);

Surely that would be easier to read expressed as:

str = StringUtils.replace(quoteless, CSV_QUOTE_STR + CSV_QUOTE_STR,
CSV_QUOTE_STR);

>         }
>
>         out.write(str);
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message