-
Notifications
You must be signed in to change notification settings - Fork 23
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
UseCollectionIsEmpty is not working as expected : changing the implementation logic #73
Comments
I have fixed this, attaching the file. If you like to merge, please merge the fix. |
Made |
Thanks, but this is not the standard way to proceed: fork + pull request. |
I am not able to do anything - may be due to my network issue. I would like to have the fix in the repository and if you help on copying the attached code yourself and create a pull request and then merge that would be good. Apart from this defect, I have got many others defects causing multiple issues in the real project. I hope, your team is working hard to improve this tool with the time. |
@rpau Can you plz check below link - Please let me know, in case I need to do anything else. |
Fixed in walkmod-sonar-plugin |
It is not working for below logic - That is why I tried to make the code simpler - there are 2 main cases -
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. |
Ok, you are right. Checking it again. |
Example below class -
`package sonar.autofix;
import java.util.List;
public class CollectionIsEmpty {
}
`
Run -
walkmod apply sonar:UseCollectionIsEmpty
After modification first "if-block" is expected to be changed to "!list.isEmpty()" (not operator is missing)
`package sonar.autofix;
import java.util.List;
public class CollectionIsEmpty {
}
`
The text was updated successfully, but these errors were encountered: