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:
@ -103,4 +103,21 @@ public class Bug1843273
|
|||||||
]]></code>
|
]]></code>
|
||||||
</test-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
|
and
|
||||||
InstanceOfExpression
|
InstanceOfExpression
|
||||||
[PrimaryExpression[count(PrimarySuffix[@ArrayDereference='true'])=0]
|
[PrimaryExpression[count(PrimarySuffix[@ArrayDereference='true'])=0]
|
||||||
//Name/@Image = ancestor::ConditionalAndExpression
|
//Name[not(contains(@Image,'.'))]/@Image = ancestor::ConditionalAndExpression
|
||||||
/EqualityExpression/PrimaryExpression/PrimaryPrefix/Name/@Image]]]
|
/EqualityExpression/PrimaryExpression/PrimaryPrefix/Name/@Image]]]
|
||||||
]]>
|
]]>
|
||||||
</value>
|
</value>
|
||||||
|
Reference in New Issue
Block a user