[ 
https://issues.apache.org/jira/browse/LUCENE-8046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

song updated LUCENE-8046:
-------------------------
    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

{code:java}
cursor=limit - v_5;
cursor=limit_backward;
{code}

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.

  was:
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` 

{code:java}
cursor=limit - v_5;
cursor=limit_backward;
{code}

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.


> Redundant assign values to one variable continuously, which makes the first 
> assignment redundant and useless
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-8046
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8046
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/analysis
>    Affects Versions: 7.0.1
>         Environment: Ubuntu 14.04.5 LTS
>            Reporter: song
>              Labels: performance
>
> 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
> {code:java}
> cursor=limit - v_5;
> cursor=limit_backward;
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to