mirror of
https://github.com/github/codeql.git
synced 2026-04-14 19:44:03 +02:00
Java: Fix mixed tabs/spaces in qhelp examples.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
public static void main(String args[]) {
|
||||
Random r = new Random();
|
||||
Random r = new Random();
|
||||
|
||||
// BAD: 'mayBeNegativeInt' is negative if
|
||||
// 'nextInt()' returns 'Integer.MIN_VALUE'.
|
||||
int mayBeNegativeInt = Math.abs(r.nextInt());
|
||||
// BAD: 'mayBeNegativeInt' is negative if
|
||||
// 'nextInt()' returns 'Integer.MIN_VALUE'.
|
||||
int mayBeNegativeInt = Math.abs(r.nextInt());
|
||||
|
||||
// GOOD: 'nonNegativeInt' is always a value between 0 (inclusive)
|
||||
// and Integer.MAX_VALUE (exclusive).
|
||||
int nonNegativeInt = r.nextInt(Integer.MAX_VALUE);
|
||||
// GOOD: 'nonNegativeInt' is always a value between 0 (inclusive)
|
||||
// and Integer.MAX_VALUE (exclusive).
|
||||
int nonNegativeInt = r.nextInt(Integer.MAX_VALUE);
|
||||
|
||||
// GOOD: When 'nextInt' returns a negative number increment the returned value.
|
||||
int nextInt = r.nextInt();
|
||||
|
||||
Reference in New Issue
Block a user