8 |
|
import java.util.Queue; |
9 |
|
|
10 |
|
public class UnboundedQueueFillEmptyLoops { |
11 |
< |
static int maxSize = 10000; |
11 |
> |
static int maxSize = 50000; |
12 |
|
static Random rng = new Random(3153122688L); |
13 |
|
static volatile int total; |
14 |
|
static Integer[] numbers; |
15 |
|
|
16 |
|
public static void main(String[] args) throws Exception { |
17 |
< |
if (args.length < 2) { |
17 |
> |
if (args.length < 1) { |
18 |
|
System.out.printf( |
19 |
< |
"Usage: UnboundedQueueFillEmptyLoops className [x maxSize]%n"); |
19 |
> |
"Usage: UnboundedQueueFillEmptyLoops className [maxSize]%n"); |
20 |
|
System.exit(1); |
21 |
|
} |
22 |
|
|
27 |
|
throw new RuntimeException("Class " + args[0] + " not found."); |
28 |
|
} |
29 |
|
|
30 |
< |
if (args.length > 2) |
31 |
< |
maxSize = Integer.parseInt(args[2]); |
30 |
> |
if (args.length > 1) |
31 |
> |
maxSize = Integer.parseInt(args[1]); |
32 |
|
|
33 |
|
System.out.printf("Class: %s size: %d%n", klass.getName(), maxSize); |
34 |
|
|