radon icon indicating copy to clipboard operation
radon copied to clipboard

Bad usage of Map in ExclusionManager can lead to undesired effects

Open ItzSomebody opened this issue 9 months ago • 0 comments

The current implementation of ExclusionManager takes a Map<String, String> as a constructor as a collection of patterns.

https://github.com/ItzSomebody/radon/blob/7d3e8719afdb832c95ca19e2817e33d2b3f36c32/xyz.itzsomebody.radon/src/main/java/xyz/itzsomebody/radon/exclusions/ExclusionManager.java#L30-L44

This is a flawed implementation because it allows for overwriting exclusion patterns in the map, causing them to vanish. Need to also change this line as well:

https://github.com/ItzSomebody/radon/blob/7d3e8719afdb832c95ca19e2817e33d2b3f36c32/xyz.itzsomebody.radon/src/main/java/xyz/itzsomebody/radon/config/ExclusionsDeserializer.java#L30-L38

Thanks to lokirus for finding the side effects of my dumb code logic errors!

ItzSomebody avatar Sep 24 '23 16:09 ItzSomebody