Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9413

String.replace Function result is ignored in lucene/analysis/kuromoji CSVUtil.quoteEscape

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.1
    • 6.2, 7.0
    • None
    • None

    Description

      Hello!

      Code in the method CSVUtil. quoteEscape

      CSVUtil.java
          if (result.indexOf('\"') >= 0) {
            result.replace("\"", ESCAPED_QUOTE);
          }
      

      ignores the return value of the String.replace method.

      Probably, is should be:

      CSVUtil.java
          if (result.indexOf('\"') >= 0) {
            result = result.replace("\"", ESCAPED_QUOTE);
          }
      

      This possible defect found by static code analyzer AppChecker

      Attachments

        1. SOLR-9413.patch
          3 kB
          Christine Poerschke

        Activity

          People

            cpoerschke Christine Poerschke
            AppChecker AppChecker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: