Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Quality: Sonar S1155 "Collection.isEmpty()" should be used to test for emptiness #1079

@jlerbsc

Description

@jlerbsc

We noticed that you have 90 violations of the Sonar rule RSPEC-1940 "Boolean checks should not be inverted". When you call isEmpty(), it clearly communicates the code’s intention, which is to check if the collection is empty. Using size() == 0 for this purpose is less direct and makes the code slightly more complex.

With our code remediation solution you can correct these issues quickly and free of charge. You can find links and documentation here https://www.indepth.fr

org\biojava\nbio\core\alignment\SimpleAlignedSequence.java
@@ -411,5  +411,5 @@

	// combine sublocations into 1 Location
\-		if (sublocations.size() == 0) {
\+		if (sublocations.isEmpty()) {
		location = null;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions