Open blipper opened 1 month ago
See https://rules.sonarsource.com/java/RSPEC-2864/
This is a SpotBugs error https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#wmi-inefficient-use-of-keyset-iterator-instead-of-entryset-iterator-wmi-wrong-map-iterator
https://github.com/spotbugs/spotbugs/blob/d999c35c134f5310b688f2b4513e3689fb1439bc/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/WrongMapIterator.java#L256
Test cases here https://github.com/spotbugs/spotbugs/blob/d999c35c134f5310b688f2b4513e3689fb1439bc/spotbugsTestCases/src/java/WMITest.java#L10
Thanks for the helpful example links; indeed would be a neat addition to see this fixed with a recipe.
Describe the situation before applying the recipe
See https://rules.sonarsource.com/java/RSPEC-2864/
Describe the situation after applying the recipe
Have you considered any alternatives or workarounds?
Any additional context
This is a SpotBugs error https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#wmi-inefficient-use-of-keyset-iterator-instead-of-entryset-iterator-wmi-wrong-map-iterator
https://github.com/spotbugs/spotbugs/blob/d999c35c134f5310b688f2b4513e3689fb1439bc/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/WrongMapIterator.java#L256
Test cases here https://github.com/spotbugs/spotbugs/blob/d999c35c134f5310b688f2b4513e3689fb1439bc/spotbugsTestCases/src/java/WMITest.java#L10
Are you interested in contributing this recipe to OpenRewrite?