ParameterNumber check after an @Override
Ronan DANIELLOU <[email protected]> Fri, 10 Aug 2012 17:57:46 +0200
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Organization | Alcatel-Lucent |
| Message-ID | <[email protected]> |
Hi everyone, I am using a rule for the parameter number. Nevertheless, I sometimes have to override some methods (in Swing, for example). Those methods may have more parameters than what the rule is configured to allow. I would like this rule to be ignored when applied to an overridden method. Does it make sense? If so, how may I do this? I have looked at suppression filters, but they work either with a configuration file (that you need to maintain) or keywords in the code (which makes you add to your files, text for a specific tool). Trying to write a custom filter, for what I have understood, it seems to allow reaching text and the lines of it, but you do not have access to a structure as you have in a check. I was worried that using some kind of text regexp on a line would be brittle. Thus I have written a custom check, inheriting from ParameterNumberCheck class. This works. But I would have to maintain it in my project locally for future checkstyle releases. Thus, is there another better way to do it? Do you think this request should become a feature request? Thanks. R. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/