This issue found using Version 7.0 (build 36138), but could be reproduced also with the latest version (as the code for the rule on master seems to allow this).
Create any Java Spring REST controller, having more than 7 parameters. If the method is annotated with @RequestMapping(…) it will be ignored by the Sonar rule, but if using any of the shortcut annotations provided by Spring, like @GetMapping, then Sonar will complain about having too many parameters.
Thanks for the feedback. Indeed, implementation of S107 in SonarJava does not cover all these annotations, which should be handled exactly like Spring’s RequestMapping.
I created the following ticket to handle it: SONARJAVA-2874
Now, feel free to open a Pull Request on SonarJava repository with the fix (that you already have) and some updated unit test. We will then review and merge it eventually. Don’t forget to have a look at our guidelines, especially regarding ruling, even if I don’t expect to get some issues disappearing there.