You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2014/07/28 23:55:39 UTC

[jira] [Created] (LUCENE-5851) org.apache.lucene.analysis.ja.util.CSVUtil#quoteEscape uses String#replace and ignores the returned value.

Mark Miller created LUCENE-5851:
-----------------------------------

             Summary: org.apache.lucene.analysis.ja.util.CSVUtil#quoteEscape uses String#replace and ignores the returned value.
                 Key: LUCENE-5851
                 URL: https://issues.apache.org/jira/browse/LUCENE-5851
             Project: Lucene - Core
          Issue Type: Bug
            Reporter: Mark Miller
            Priority: Minor


{code}
  /**
   * Quote and escape input value for CSV
   */
  public static String quoteEscape(String original) {
    String result = original;
    
    if (result.indexOf('\"') >= 0) {
      result.replace("\"", ESCAPED_QUOTE);
    }
    if(result.indexOf(COMMA) >= 0) {
      result = "\"" + result + "\"";
    }
    return result;
  }
{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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