mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-CR-13651 BoolUtils.getNegatedExpressionText() used and fixed for float/double (to preserve semantics for NaNs)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with sum()" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
interface Person {
|
||||
double getAge();
|
||||
}
|
||||
|
||||
public double test(List<Person> collection) {
|
||||
double d = collection.stream().filter(person -> !(person.getAge() == 10)).mapToDouble(Person::getAge).sum();
|
||||
return d;
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// "Replace with sum()" "true"
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Main {
|
||||
interface Person {
|
||||
double getAge();
|
||||
}
|
||||
|
||||
public double test(List<Person> collection) {
|
||||
double d = 0;
|
||||
for(Person person : collec<caret>tion) {
|
||||
if(person.getAge() == 10)
|
||||
continue;
|
||||
d = d + person.getAge();
|
||||
}
|
||||
return d;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user