moving some rules around
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@853 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -5,6 +5,25 @@
|
||||
This is the sandbox.
|
||||
</description>
|
||||
|
||||
<rule name="UnnecessaryCast"
|
||||
message="Avoid unnecessary casts"
|
||||
class="net.sourceforge.pmd.rules.UnnecessaryCastRule">
|
||||
<description>
|
||||
A variable is cast to itself, one of its supertypes or one of its interfaces. Usually
|
||||
indicates that the programmer is not clear on the class structure they
|
||||
are working with.
|
||||
</description>
|
||||
|
||||
<example>
|
||||
<![CDATA[
|
||||
public Collection doSomething() {
|
||||
List list = new ArrayList();
|
||||
|
||||
return (Collection) list; // Unnecessary Cast
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
</rule>
|
||||
|
||||
<rule name="PositionalIterator"
|
||||
message="Avoid positional iterators"
|
||||
|
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<ruleset name="future">
|
||||
<description>
|
||||
These are rules for the future, when we're doing cross-class type checking and such
|
||||
</description>
|
||||
|
||||
|
||||
<rule name="UnnecessaryCast"
|
||||
message="Avoid unnecessary casts"
|
||||
class="net.sourceforge.pmd.rules.UnnecessaryCastRule">
|
||||
<description>
|
||||
A variable is cast to itself, one of its supertypes or one of its interfaces. Usually
|
||||
indicates that the programmer is not clear on the class structure they
|
||||
are working with.
|
||||
</description>
|
||||
|
||||
<example>
|
||||
<![CDATA[
|
||||
public Collection doSomething() {
|
||||
List list = new ArrayList();
|
||||
|
||||
return (Collection) list; // Unnecessary Cast
|
||||
}
|
||||
]]>
|
||||
</example>
|
||||
</rule>
|
||||
|
||||
|
||||
</ruleset>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user