CNC_COLLECTION_NAMING_CONFUSION should match entire words only
I’ve had some false positives with CNC_COLLECTION_NAMING_CONFUSION when using names like offset, asset for collections that were not sets.
I think CNC_COLLECTION_NAMING_CONFUSION should only match if the magic words it searches for (map/set/list/queue) are single words on camel/snake case boundaries.
For example, the following should match:
- map
- Map
- MAP
- asSet
- SOME_SET
While these shouldn’t:
- asset
- spielbergsEt
- runNmap
- COMMAND_NMAP
- TAG_NAMES_LI_ST
Also, I’m not sure why you’re excluding toset from the check. Shouldn’t a method named toSet usually return a set?
I suggest you also include checks for the words deque and stack (which should match the java.util.Deque interface).
better to avoid deque in naming, same problem https://github.com/checkstyle/checkstyle/pull/12855#issuecomment-1474846212