M
Marcin Rze¼nicki
That's not a valid rule.
Well, I checked docs for this tool. Some of its rules are confusing,
to say the least. Take:
<docs>
AvoidUsingVolatile
Use of the keyword 'volatile' is general used to fine tune a Java
application, and therefore, requires a good expertise of the Java
Memory Model. Moreover, its range of action is somewhat misknown.
Therefore, the volatile keyword should not be used for maintenance
purpose and portability.
</docs>
volatile has strict semantics - it is not used to 'fine tune'
anything, its range of action is completely known, it is as portable
as anything.
<docs>
ExcessiveImports
A high number of imports can indicate a high degree of coupling within
an object. Rule counts the number of unique imports and reports a
violation if the count is above the user defined threshold.
</docs>
Really?
<docs>
UseArrayListInsteadOfVector
ArrayList is a much better Collection implementation than Vector.
</docs>
Never-mind the semantics differ
<docs>
UseStringBufferForStringAppends
Finds usages of += for appending strings.
</docs>
See the generated byte code, at least two compilers do it for you.
Whole set of rules concerning braces is controversial, at least for me
- and any good IDE can do it for you anyway.
I think that using this tool isn't worth the trouble, as OP example
shows you spend more time fighting with it than you should, even when
your code is logically valid.