Test case and fix for bug [2317099 ] false + in SimplifyConditional.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6855 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2009-02-19 22:23:19 +00:00
parent 5a1a457eae
commit 6bc10af45e
2 changed files with 19 additions and 2 deletions

View File

@ -103,4 +103,21 @@ public class Bug1843273
]]></code>
</test-code>
</test-data>
<test-code regressionTest="false">
<description><![CDATA[
Bug 2317099 : False + in SimplifyConditional
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Bug2317099
{
public void method(Env env) {
if (env != null && env.getContext() != null
&& env.getContext().getContextObject() instanceof PageContext) {
}
}
}
]]></code>
</test-code>
</test-data>

View File

@ -1061,7 +1061,7 @@ ConditionalAndExpression
and
InstanceOfExpression
[PrimaryExpression[count(PrimarySuffix[@ArrayDereference='true'])=0]
//Name/@Image = ancestor::ConditionalAndExpression
//Name[not(contains(@Image,'.'))]/@Image = ancestor::ConditionalAndExpression
/EqualityExpression/PrimaryExpression/PrimaryPrefix/Name/@Image]]]
]]>
</value>