Methods should not be empty (java:S1186) in AspectJ @Pointct

Hi,

I’m sorry to bring up this topic that was already closed ( @Pointcut vs. S1186 & S2325 - Report a False-positive / False-negative, and it’s associated jira ticket, [SONARJAVA-3668] FP on S1186: method annotated @Pointcut from AspectJ are often expected to be empty.

However, I don’t accept the “solution” on the topic that " some developers comment these methods to explain why they are empty. Thus the rule still seems to make sense for them."

Sure, adding a comment so that SonarLint stops calling out the “critical code smell” is easy enough for one or 2 Pointcut methods, but if you have a lot, the code can become cluttered with these repeated comments for each Pointcut method.

Therefore, I would think that a compliant solution would include methods annotated with Pointcut (in addition to adding a nested comment or throwing UnsupportedOperationException.