mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 18:09:38 +07:00
IDEA-205308 'Replace with max()' produces uncompilable source
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// "Replace with max()" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
class Scratch {
|
||||
native int scale();
|
||||
|
||||
private static Integer getMaxScale(Collection<Scratch> updated) {
|
||||
int maxScale = updated.stream().mapToInt(Scratch::scale).filter(b -> b >= 0).max().orElse(0);
|
||||
return maxScale;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace with max()" "true"
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
class Scratch {
|
||||
native int scale();
|
||||
|
||||
private static Integer getMaxScale(Collection<Scratch> updated) {
|
||||
int maxScale = 0;
|
||||
f<caret>or (Scratch b : updated) {
|
||||
if (maxScale < b.scale()) {
|
||||
maxScale = b.scale();
|
||||
}
|
||||
}
|
||||
return maxScale;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user