mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
14 lines
338 B
Java
14 lines
338 B
Java
class Test {
|
|
public void bad() {
|
|
for (int i=0; i<10; i++) {
|
|
for (int j=0; i<10; j++) {
|
|
// potentially infinite loop due to test on wrong variable
|
|
if (shouldBreak()) break;
|
|
}
|
|
}
|
|
}
|
|
private boolean shouldBreak() {
|
|
return Math.random() < 0.5;
|
|
}
|
|
}
|