forked from phoedos/pmd
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:
parent
5a1a457eae
commit
6bc10af45e
@ -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>
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user