ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/UnboundedQueueFillEmptyLoops.java
(Generate patch)

Comparing jsr166/src/test/loops/UnboundedQueueFillEmptyLoops.java (file contents):
Revision 1.13 by jsr166, Sat Oct 29 06:23:09 2016 UTC vs.
Revision 1.14 by jsr166, Sat Oct 29 06:37:34 2016 UTC

# Line 14 | Line 14 | public class UnboundedQueueFillEmptyLoop
14      static Integer[] numbers;
15  
16      public static void main(String[] args) throws Exception {
17 <        Class<?> klass = null;
18 <        if (args.length > 0) {
19 <            try {
20 <                klass = Class.forName(args[0]);
21 <            } catch (ClassNotFoundException e) {
22 <                throw new RuntimeException("Class " + args[0] + " not found.");
23 <            }
17 >        if (args.length < 2) {
18 >            System.out.printf(
19 >                "Usage: UnboundedQueueFillEmptyLoops className [x maxSize]%n");
20 >            System.exit(1);
21 >        }
22 >
23 >        final Class<?> klass;
24 >        try {
25 >            klass = Class.forName(args[0]);
26 >        } catch (ClassNotFoundException e) {
27 >            throw new RuntimeException("Class " + args[0] + " not found.");
28          }
29  
30          if (args.length > 2)
31              maxSize = Integer.parseInt(args[2]);
32  
33 <        System.out.print("Class: " + klass.getName());
30 <        System.out.println(" size: " + maxSize);
33 >        System.out.printf("Class: %s size: %d%n", klass.getName(), maxSize);
34  
35          numbers = new Integer[maxSize];
36          for (int i = 0; i < maxSize; ++i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines