Test case to reproduce [1732744] False + : basic/UselessOperationOnImmutable

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/branches/pmd/4.2.x@6810 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse 2009-01-29 13:48:18 +00:00
parent d20f8f2291
commit d740f68a94

View File

@ -161,5 +161,26 @@ public class Foo {
}
]]></code>
</test-code>
<test-code regressionTest="false">
<description><![CDATA[
[1732744] False + : basic/UselessOperationOnImmutable
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public BigDecimal myMethod(Object pObj)
{
BigDecimal cout = null;
//...
cout = (cout == null ? pObj.getABigDecimal() : cout.add(
pObj.getABigDecimal() ) );
//...
return cout;
}
]]></code>
</test-code>
</test-data>