mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
25 lines
393 B
Java
25 lines
393 B
Java
public class A {
|
|
Object source() { return null; }
|
|
void sink(Object o) { }
|
|
|
|
boolean isSafe(Object o) { return o == null; }
|
|
|
|
void foo() {
|
|
Object x = source();
|
|
if (!isSafe(x)) {
|
|
x = null;
|
|
}
|
|
sink(x);
|
|
|
|
x = source();
|
|
if (!isSafe(x)) {
|
|
if (isSafe(x)) {
|
|
sink(x);
|
|
} else {
|
|
throw new RuntimeException();
|
|
}
|
|
}
|
|
sink(x);
|
|
}
|
|
}
|