Skip to content

UseCollectionIsEmpty is not working as expected : changing the implementation logic : Cloned #74

@subisueno

Description

@subisueno

It is not working for below logic -
if(0 < myList.size()){ System.out.println("My List is not Empty."); }
I personally feel, the code can be made simpler. I saw the code logic is too complex and that is why it is really difficult to maintain this code working in so many test-cases.

That is why I tried to make the code simpler - there are 2 main cases -

isEmpty
!isEmpty
Now, If we write the code such a way that a simple change would include / exclude (while fixing any bug) a particular condition from deriving any of the above. So, a Set data-structure would help us to hold the set of conditions. If anyone of them is working the entire set of conditions should be working.
walkmod/walkmod-sonar-plugin#12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions