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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.1
    • Fix Version/s: 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: