forked from phoedos/pmd
verify #1340 UseStringBufferForStringAppends False Positive with ternary operator
This commit is contained in:
@ -134,4 +134,17 @@ public class Foo {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description>#1340 UseStringBufferForStringAppends False Positive with ternary operator</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class UseStringBuffer {
|
||||
public void foo() {
|
||||
String country = (country == null || "".equals(country))
|
||||
? ((String) getCountry())
|
||||
: country;
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user