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

sonar:UseCollectionIsEmpty inverts condition #7

Open
dalejunas opened this issue Jun 23, 2017 · 1 comment
Open

sonar:UseCollectionIsEmpty inverts condition #7

dalejunas opened this issue Jun 23, 2017 · 1 comment

Comments

@dalejunas
Copy link

UseCollectionIsEmpty violation fix inverts condition
from
if( list1.size() > 0 ){ ... }

to
if( list1.isEmpty() ){ ... }

@dalejunas dalejunas changed the title sonar:UseCollectionIsEmpty sonar:UseCollectionIsEmpty inverts condition Jun 23, 2017
@subisueno
Copy link

There are many other cases, which may fail.
Such as - if (0 < list.size)
list.size >= 1
etc.
Please refer to below link -
https://github.com/walkmod/walkmod-core/issues/73

The change is attached in this link. Can someone review the changes, and place the fix. As, I am not able to create pull request ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants