Does anybody have some kind of “code style” annotations in the project, ex: @OverEngineered for over-complexed code or @Duplicated… etc.
Ideally I’d subclass @Deprecated for that (@OverEngineered extends @Deprecated) to get the IDE highlight it, but java annotations are not inherited.
So I wonder if there is some workaround to get the IDE to highlight such code-style custom annotations as deprecated? Or is this the wrong way or wrong task in general?
You could write a family of these annotations, and then use them alongside
@Deprecated. The latter gets you the warnings, the former supply the details to human readers. You could write a Checkstyle rule to require that every deprecated thing has an explanatory annotation, and/or that every explanation accompanies a deprecation.Rather than writing several annotations, though, i’d write one, which takes an explanatory label as a parameter. I’d call it
@BecauseItIs. So: