forked from phoedos/pmd
undo previous commit
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4859 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -434,7 +434,7 @@ public class Foo {
|
|||||||
|
|
||||||
<rule name="OptimizableToArrayCall"
|
<rule name="OptimizableToArrayCall"
|
||||||
message="This call to Collection.toArray() may be optimizable"
|
message="This call to Collection.toArray() may be optimizable"
|
||||||
class="net.sourceforge.pmd.rules.xpath.PrimaryExpressionXPathRule"
|
class="net.sourceforge.pmd.rules.XPathRule"
|
||||||
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#OptimizableToArrayCall">
|
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#OptimizableToArrayCall">
|
||||||
<description>
|
<description>
|
||||||
A call to Collection.toArray can use the Collection's size vs an empty Array of the desired type.
|
A call to Collection.toArray can use the Collection's size vs an empty Array of the desired type.
|
||||||
@ -443,7 +443,7 @@ A call to Collection.toArray can use the Collection's size vs an empty Array of
|
|||||||
<property name="xpath">
|
<property name="xpath">
|
||||||
<value>
|
<value>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
.
|
//PrimaryExpression
|
||||||
[PrimaryPrefix/Name[ends-with(@Image, 'toArray')]]
|
[PrimaryPrefix/Name[ends-with(@Image, 'toArray')]]
|
||||||
[
|
[
|
||||||
PrimarySuffix/Arguments/ArgumentList/Expression
|
PrimarySuffix/Arguments/ArgumentList/Expression
|
||||||
@ -502,7 +502,7 @@ public class Bar {
|
|||||||
|
|
||||||
<rule name="EqualsNull"
|
<rule name="EqualsNull"
|
||||||
message="Avoid using equals() to compare against null"
|
message="Avoid using equals() to compare against null"
|
||||||
class="net.sourceforge.pmd.rules.xpath.PrimaryExpressionXPathRule"
|
class="net.sourceforge.pmd.rules.XPathRule"
|
||||||
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#EqualsNull">
|
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#EqualsNull">
|
||||||
<description>
|
<description>
|
||||||
Inexperienced programmers sometimes confuse comparison concepts
|
Inexperienced programmers sometimes confuse comparison concepts
|
||||||
@ -512,7 +512,7 @@ and use equals() to compare to null.
|
|||||||
<property name="xpath">
|
<property name="xpath">
|
||||||
<value>
|
<value>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
.
|
//PrimaryExpression
|
||||||
[
|
[
|
||||||
PrimaryPrefix/Name[ends-with(@Image, 'equals')]
|
PrimaryPrefix/Name[ends-with(@Image, 'equals')]
|
||||||
or
|
or
|
||||||
@ -679,7 +679,7 @@ public class Foo {
|
|||||||
|
|
||||||
<rule name="UseLocaleWithCaseConversions"
|
<rule name="UseLocaleWithCaseConversions"
|
||||||
message="When doing a String.toLowerCase()/toUpperCase() call, use a Locale"
|
message="When doing a String.toLowerCase()/toUpperCase() call, use a Locale"
|
||||||
class="net.sourceforge.pmd.rules.xpath.PrimaryExpressionXPathRule"
|
class="net.sourceforge.pmd.rules.XPathRule"
|
||||||
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#UseLocaleWithCaseConversions">
|
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#UseLocaleWithCaseConversions">
|
||||||
<description>
|
<description>
|
||||||
When doing a String.toLowerCase()/toUpperCase() call, use a Locale. This avoids
|
When doing a String.toLowerCase()/toUpperCase() call, use a Locale. This avoids
|
||||||
@ -707,7 +707,7 @@ class Foo {
|
|||||||
<property name="xpath">
|
<property name="xpath">
|
||||||
<value>
|
<value>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
.
|
//PrimaryExpression
|
||||||
[PrimaryPrefix/Name
|
[PrimaryPrefix/Name
|
||||||
[ends-with(@Image, 'toLowerCase') or ends-with(@Image,
|
[ends-with(@Image, 'toLowerCase') or ends-with(@Image,
|
||||||
'toUpperCase')]
|
'toUpperCase')]
|
||||||
@ -1068,7 +1068,7 @@ class Foo {
|
|||||||
|
|
||||||
<rule name="PositionLiteralsFirstInComparisons"
|
<rule name="PositionLiteralsFirstInComparisons"
|
||||||
message="Position literals first in String comparisons"
|
message="Position literals first in String comparisons"
|
||||||
class="net.sourceforge.pmd.rules.xpath.PrimaryExpressionXPathRule"
|
class="net.sourceforge.pmd.rules.XPathRule"
|
||||||
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#PositionLiteralsFirstInComparisons">
|
externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#PositionLiteralsFirstInComparisons">
|
||||||
<description>
|
<description>
|
||||||
Position literals first in String comparisons - that way if the String is null you won't get a NullPointerException, it'll just return false.
|
Position literals first in String comparisons - that way if the String is null you won't get a NullPointerException, it'll just return false.
|
||||||
@ -1076,7 +1076,7 @@ class Foo {
|
|||||||
<properties>
|
<properties>
|
||||||
<property name="xpath">
|
<property name="xpath">
|
||||||
<value><![CDATA[
|
<value><![CDATA[
|
||||||
.[PrimaryPrefix[Name[ends-with(@Image, '.equals')]][..//Literal]]
|
//PrimaryExpression[PrimaryPrefix[Name[ends-with(@Image, '.equals')]][..//Literal]]
|
||||||
[not(ancestor::Expression/ConditionalAndExpression//EqualityExpression[@Image='!=']//NullLiteral)]
|
[not(ancestor::Expression/ConditionalAndExpression//EqualityExpression[@Image='!=']//NullLiteral)]
|
||||||
[not(ancestor::Expression/ConditionalOrExpression//EqualityExpression[@Image='==']//NullLiteral)]
|
[not(ancestor::Expression/ConditionalOrExpression//EqualityExpression[@Image='==']//NullLiteral)]
|
||||||
]]></value>
|
]]></value>
|
||||||
|
Reference in New Issue
Block a user