mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
MigrateToStreamFix: explicit formatting removed (as formatted anyways automatically)
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparing(Person::getName)).orElse(null);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparing(Person::getName)).orElse(null);
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void work(int[] ints) {
|
||||
int max = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt >= 0).max().orElse(0);
|
||||
int max = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt >= 0).max().orElse(0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void work(int[] ints) {
|
||||
int max = Arrays.stream(ints).max().orElse(Integer.MIN_VALUE);
|
||||
int max = Arrays.stream(ints).max().orElse(Integer.MIN_VALUE);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -27,6 +27,6 @@ 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);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ 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);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(p -> p.age)).orElse(null);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).max(Comparator.comparingInt(p -> p.age)).orElse(null);
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
Person maxPerson = personList.stream().filter(p -> p.getAge() > 13).filter(p -> p.getAge() >= 0).max(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
|
||||
return maxPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
class Main {
|
||||
public void work(long[] ints) {
|
||||
long max = Arrays.stream(ints).filter(anInt -> anInt < 10).max().orElse(Long.MIN_VALUE);
|
||||
long max = Arrays.stream(ints).filter(anInt -> anInt < 10).max().orElse(Long.MIN_VALUE);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void work(int[] ints) {
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void work(Integer[] ints) {
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).mapToInt(anInt -> anInt).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).mapToInt(anInt -> anInt).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.*;
|
||||
|
||||
public class Main {
|
||||
public void work(int[] ints) {
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + 2343).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + 2343).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ import java.util.Arrays;
|
||||
|
||||
public class Main {
|
||||
public void work(int[] ints) {
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + anInt * 2 - 10).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
int min = Arrays.stream(ints).filter(anInt -> anInt < 10).map(anInt -> anInt + anInt * 2 - 10).filter(anInt -> anInt <= 0).min().orElse(0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.comparingInt(Person::getAge)).orElse(null);
|
||||
|
||||
return minPerson;
|
||||
}
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class Main {
|
||||
new Person("James", 25),
|
||||
new Person("Kelly", 12)
|
||||
);
|
||||
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.naturalOrder()).orElse(null);
|
||||
Person minPerson = personList.stream().filter(p -> p.getAge() > 13).min(Comparator.naturalOrder()).orElse(null);
|
||||
|
||||
return minPerson;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user