> Hello,
> How can I implement a rule with checkstyle that would warn when the
[quoted text clipped - 6 lines]
>
> thanks
Hello,
I Have no experience with checkstyle, but based on my understanding of
your question I think that java assertions may fit your requirements.
See
http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
for more details.
Alternatively, you could just have your method throw an
IllegalArgumentException if the argument was out of range.
Hope this helps,
Carl.
Oliver Wong - 30 Mar 2006 20:50 GMT
>> Hello,
>> How can I implement a rule with checkstyle that would warn when the
[quoted text clipped - 18 lines]
> Alternatively, you could just have your method throw an
> IllegalArgumentException if the argument was out of range.
Presumably the OP wishes to check for these violations at compile time
(because they've got an ant script to automatically run checkstyle right
after compilation, for example), rather than runtime. I'm not familiar with
checkstyle, so I don't know how to solve this using CheckStyle either, but
it can be solved using AspectJ.
- Oliver