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

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

Open
jlerbsc opened this issue Mar 9, 2024 · 0 comments

Comments

@jlerbsc
Copy link

jlerbsc commented Mar 9, 2024

Below is another example of what our java code remediation solution has detected in the project's source code. In this case there are 99 violations of the Sonar rule S1155 "Collection.isEmpty()" should be used to test for emptiness".
Below is an example of how our Indepth solution could fix the problem (https://www.indepth.fr)
For your information, using Indepth is free for all Opensource projects.

com\eviware\soapui\ui\navigator\state\NavigatorNodesExpandStateEngine.java
@@ -83,5  +83,5 @@
    private NavigatorNodesExpandStateProvider getNavigatorNodesExpandStateProvider() {
        List<NavigatroNodeExpandStateProviderFactory> stateProviderFactoryList = SoapUI.getFactoryRegistry().getFactories(NavigatroNodeExpandStateProviderFactory.class);
-        if (stateProviderFactoryList.size() == 0) {
+        if (stateProviderFactoryList.isEmpty()) {
            return null;
        }
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

1 participant