Fixed the test and added a second one
This commit is contained in:
@ -576,13 +576,29 @@ public class Bar extends Foo {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
<!--test-code>
|
||||
<description>Predicates are treated like booleans</description>
|
||||
<expected-problems>1</expected-problems>
|
||||
<test-code>
|
||||
<description>Predicate properties are treated like booleans</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class ClassWithPredicates {
|
||||
public Predicate<String> isNotEmpty = string -> !string.isEmpty();
|
||||
}
|
||||
]]></code>
|
||||
</test-code-->
|
||||
</test-code>
|
||||
<test-code>
|
||||
<description>Predicate variables are treated like booleans</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class SomeClass {
|
||||
public static void main(String[] args) {
|
||||
Predicate<String> isEmpty = string -> string.isEmpty();
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
</test-data>
|
||||
|
Reference in New Issue
Block a user