Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dead stores should be removed (sonar rule) #4329

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

jlerbsc
Copy link
Collaborator

@jlerbsc jlerbsc commented Feb 29, 2024

A dead store happens when a local variable is assigned a value that is not read by any subsequent instruction. Calculating or retrieving a value only to then overwrite it or throw it away, could indicate a serious error in the code. Even if it's not an error, it is at best a waste of resources. Therefore all calculated values should be used.

@jlerbsc jlerbsc merged commit a0727de into javaparser:master Feb 29, 2024
38 checks passed
@jlerbsc jlerbsc added this to the next release milestone Feb 29, 2024
@jlerbsc jlerbsc added the PR: Fixed A PR that offers a fix or correction label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Fixed A PR that offers a fix or correction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant