Current code have a small bug that if one check is listed in both checkNamesForContextStrategyByTokenOrAncestorSet and checkNamesForContextStrategyByTokenOrParentSet, then some unexpected error may happen. Because the logic in current code, after the list get its ancestors' node, it still will get its ancestors' node's parent again.
Current code have a small bug that if one check is listed in both checkNamesForContextStrategyByTokenOrAncestorSet and checkNamesForContextStrategyByTokenOrParentSet, then some unexpected error may happen. Because the logic in current code, after the list get its ancestors' node, it still will get its ancestors' node's parent again.
https://github.com/checkstyle/patch-filters/blob/36d47cbfd4e988ad568ab9d2783688b2a20b8776/src/main/java/com/puppycrawl/tools/checkstyle/filters/JavaPatchFilterElement.java#L282-L302