mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 08:50:57 +07:00
23 lines
446 B
Java
23 lines
446 B
Java
// "Unwrap 'if' statement extracting side effects" "true-preview"
|
|
class Test {
|
|
void foo(Object obj) {
|
|
if (!(obj instanceof Rect)) {
|
|
return;
|
|
}
|
|
if (<caret>obj instanceof Rect(Point pos, Size 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) {
|
|
}
|