mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
- extracted new option - reuse this option in MissortedModifiersInspection - override uses this option too GitOrigin-RevId: 39f3f72991240753c86c7f80df865728aa9743ad
39 lines
740 B
Java
39 lines
740 B
Java
import org.jetbrains.annotations.Nullable;
|
|
|
|
import java.util.List;
|
|
|
|
public class NullableCheckBreakDuplicate {
|
|
List<Pojo> things;
|
|
|
|
void foo() {
|
|
while (true) {
|
|
|
|
Pojo x = newMethod();
|
|
if (x == null) break;
|
|
System.out.println(x.it);
|
|
}
|
|
}
|
|
|
|
@Nullable
|
|
private NullableCheckBreakDuplicate.Pojo newMethod() {
|
|
Pojo x = things.get(0);
|
|
|
|
if (x.it > 0) return null;
|
|
things.remove(x);
|
|
return x;
|
|
}
|
|
|
|
void baz() {
|
|
while (true) {
|
|
Pojo x = newMethod();
|
|
if (x == null) break;
|
|
System.out.println(x.it);
|
|
}
|
|
}
|
|
|
|
static class Pojo {
|
|
double it;
|
|
Pojo(double w) { it = w; }
|
|
}
|
|
}
|