Skip to content

Commit 5101a8e

Browse files
authored
Fix qhelp test
1 parent 136ecaf commit 5101a8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class SleepTest {
22
public void test(int userSuppliedWaitTime) throws Exception {
33
// BAD: no boundary check on wait time
4-
Thread.sleep(waitTime);
4+
Thread.sleep(userSuppliedWaitTime);
55

66
// GOOD: enforce an upper limit on wait time
7-
if (waitTime > 0 && waitTime < 5000) {
8-
Thread.sleep(waitTime);
7+
if (userSuppliedWaitTime > 0 && userSuppliedWaitTime < 5000) {
8+
Thread.sleep(userSuppliedWaitTime);
99
}
1010
}
1111
}

0 commit comments

Comments
 (0)