mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-182623 Replace with collect swallows comments
This commit is contained in:
+3
-1
@@ -27,7 +27,9 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
/*age*/
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > /*thirteen*/ 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
// max!
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+3
-3
@@ -29,9 +29,9 @@ public class Main {
|
||||
);
|
||||
Person maxPerson = null;
|
||||
for <caret>(Person p : personList) {
|
||||
if(p.getAge() > 13) {
|
||||
if (maxPerson == null || p.getAge() > maxPerson.getAge()) {
|
||||
maxPerson = p;
|
||||
if(p.getAge() > /*thirteen*/ 13) {
|
||||
if (maxPerson == null || p./*age*/getAge() > maxPerson.getAge()) {
|
||||
maxPerson = p; // max!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user