[java:S1123] Suddenly new issues after targeting Java >= 9

This is not a false-positive per se, but rather a too strict rule.

The rule S1123 checks whether a method annotated with @Deprecated has a Javadoc tag @deprecated and vice versa. This is pretty useful because with only the annotation one would not know what the intended replacement for the method or class is.
With SonarJava 4.11 a change was made to the requiring one of the annotation attributes since or 'forRemoval` to be set when using Java >= 9.
This has one of the following implications:

  1. Existing code targeting Java >= 9 with methods/classes annotated/tagged as deprecated and conforming to the rule (with SonarJava < 4.11) is suddenly non-conformant after updating the rule
  2. Existing code targeting Java < 9 with methods/classes annotated/tagged as deprecated and conforming to the rule (with SonarJava >= 4.11) is suddenly non-conformant after targeting Java >= 9

This causes new issues and possibly more work. In my opinion, checking the annotation attributes should have been optional. Thus I kindly ask to either make the attribute check optional or to split this new feature into a separate rule.

Hello @oliver

To me, this problem can be addressed thanks to the Clean as You Code idea.
Existing issues are not the main focus (unless blocker), so news issues on old code do not really add more work. This rule will in fact make sure that new code written in Java 9 will respect the conventions.

Does it clarify the situation?