Fixed bug 1932242 - EmptyMethodInAbstractClassShouldBeAbstract false +

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@5952 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2008-04-02 16:47:36 +00:00
parent 4d127404d3
commit 4378fd6bdf
3 changed files with 24 additions and 1 deletions

View File

@ -2,6 +2,7 @@
'41' and '42' shortcuts for rulesets added
Fixed bug 1928009 - Error using migration ruleset in PMD 4.2
Fixed bug 1932242 - EmptyMethodInAbstractClassShouldBeAbstract false +
March 25, 2008 - 4.2:

View File

@ -184,4 +184,20 @@ public abstract class ShouldBeAbstract
}
]]></code>
</test-code>
<test-code>
<description><![CDATA[
Bug 1932242 : False +, returning a String does not count as an Empty Method
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public abstract class Foo
{
protected String bar()
{
return "A valid, not null, string";
}
}
]]></code>
</test-code>
</test-data>

View File

@ -1441,8 +1441,14 @@ rather than code the appropriate one.
[
( boolean(./Block[count(./BlockStatement) = 1]/BlockStatement/Statement/ReturnStatement/Expression/PrimaryExpression/PrimaryPrefix/Literal/NullLiteral) = 'true' )
or
( boolean(./Block[count(./BlockStatement) = 1]/BlockStatement/Statement/ReturnStatement/Expression/PrimaryExpression/PrimaryPrefix/Literal[@Image = '0']) = 'true' )
or
( boolean(./Block[count(./BlockStatement) = 1]/BlockStatement/Statement/ReturnStatement/Expression/PrimaryExpression/PrimaryPrefix/Literal[string-length(@Image) = 2]) = 'true' )
or
(
(boolean(./Block/BlockStatement/Statement/ReturnStatement/Expression/PrimaryExpression/PrimaryPrefix/Literal) = 'true' )
(
(boolean(./Block/BlockStatement/Statement/ReturnStatement/Expression/PrimaryExpression/PrimaryPrefix/Literal[@Image = '']) = 'true' )
)
and
( count (./Block/*) = 1 )
)