mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 15:50:49 +07:00
IDEA-300018 GitOrigin-RevId: 2f6d431cfb3baf2961ad560abdabd6fd373ef6b6
24 lines
471 B
Java
24 lines
471 B
Java
// "Unwrap 'if' statement extracting side effects" "true-preview"
|
|
class Test {
|
|
void foo(Object obj) {
|
|
if (!(obj instanceof Rect)) {
|
|
return;
|
|
}
|
|
Rect rect = (Rect) obj;
|
|
Point pos = rect.pos();
|
|
Size size = rect.size();
|
|
System.out.println(pos);
|
|
System.out.println(pos.x());
|
|
System.out.println(size.h());
|
|
}
|
|
}
|
|
|
|
record Point(double x, double y) {
|
|
}
|
|
|
|
record Size(double w, double h) {
|
|
}
|
|
|
|
record Rect(Point pos, Size size) {
|
|
}
|