Chris Mair - 2012-12-03

The problem here seems to be that the @SuppressWarnings support, implemented in the SuppressionAnalyzer class, is based on checking for annotations on ASTNodes -- class, field, method, etc..

But this rule is one of the few that is based on iterating through the source code rather than processing/visiting ASTNodes, so those annotations on AST nodes are ignored.

One option that occurs to me is to redesign this rule so that it processes the source code for each class individually, checking the source lines between the class start and end. It would use the typical visitClassNode() behavior, getting the suppression processing along with that. One downside of that is that it would work only for class-level annotations, so if the user puts a @SuppressWarnings annotation on the method, it would be ignored -- partial solution and partial confusion :)

For now, I will update the rule doc, noting this current limitation.