Is it possible to have different severity levels for the same module but with different properties?
This is what I am looking at:
<module name="IllegalThrows">
<property name="illegalClassNames" value="NullPointerException,java.lang.RuntimeException,Exception"/>
</module>
<module name="IllegalThrows">
<property name="illegalClassNames" value="Exception"/>
<property name="severity" value="warning"/>
</module>
Yes, that's perfectly ok! There are some minor glitches in your example code; here's a slightly modified version:
<module name="IllegalThrows">
<property name="severity" value="warning"/>
<property name="illegalClassNames"
value="java.lang.NullPointerException,java.lang.RuntimeException"/>
</module>
<module name="IllegalThrows">
<property name="severity" value="error"/>
<property name="illegalClassNames" value="java.lang.Exception"/>
</module>
I set a severity
on both modules. One can be left out if it is the same as the configured default severity (usually warning
). Also, I removed the redundancy where Exception
was declared in both modules. This would have caused you to get two issues for the same line of code. It is sufficient to specify only the fully qualified class names.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With