forked from phoedos/pmd
Add test for #5113
This commit is contained in:
parent
c73e5cb8b1
commit
a72ac5845b
@ -2218,4 +2218,24 @@ public class ObtainViaTest {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>UnusedPrivateMethod #5113</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import java.util.Optional;
|
||||
|
||||
public class VarTest {
|
||||
public Optional<Boolean> foo(int param) {
|
||||
var optional = param == 0 ? Optional.of(true) : Optional.of(false);
|
||||
return optional.flatMap(this::dummy);
|
||||
}
|
||||
|
||||
private Optional<Boolean> dummy(boolean foo) {
|
||||
return Optional.of(foo);
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
</test-data>
|
||||
|
Loading…
x
Reference in New Issue
Block a user