Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8046

Redundant assign values to one variable continuously, which makes the first assignment redundant and useless

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 7.0.1
    • None
    • modules/analysis
    • Ubuntu 14.04.5 LTS

    • Patch Available

    Description

      Our static code analysis tool has scanned the codebase of Lucene 7.0.1, and find 29 cases, that developers reassigned values to a variable continuously.

      For example, the following code from file:
      analysis/common/src/java/org/tartarus/snowball/ext/CatalanStemmer.java

      cursor=limit - v_5;
      cursor=limit_backward;
      

      In the above code snippet, the second statement makes the first one redundant and useless.
      There are 29 cases in total in the codebase of Lucene.

      Attachments

        1. patch.LUCENE-8046
          20 kB
          song

        Activity

          People

            Unassigned Unassigned
            wangsonging song
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: