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

Comparing jsr166/src/test/loops/SetBash.java (file contents):
Revision 1.1 by dl, Mon May 2 19:19:38 2005 UTC vs.
Revision 1.4 by jsr166, Mon Nov 2 23:51:32 2009 UTC

# Line 1 | Line 1
1 + /*
2 + * Written by Doug Lea and Josh Bloch with assistance from members of
3 + * JCP JSR-166 Expert Group and released to the public domain, as
4 + * explained at http://creativecommons.org/licenses/publicdomain
5 + */
6   import java.util.*;
7  
8   public class SetBash {
# Line 10 | Line 15 | public class SetBash {
15  
16          try {
17              cl = Class.forName(args[0]);
18 <        } catch(ClassNotFoundException e) {
18 >        } catch (ClassNotFoundException e) {
19              fail("Class " + args[0] + " not found.");
20          }
21  
# Line 87 | Line 92 | public class SetBash {
92  
93      static Set newSet(Class cl, boolean synch) {
94          try {
95 <            Set s = (Set)cl.newInstance();
95 >            Set s = (Set) cl.newInstance();
96              if (synch)
97                  s = Collections.synchronizedSet(s);
98              if (!s.isEmpty())
99                  fail("New instance non empty.");
100              return s;
101 <        } catch(Throwable t) {
101 >        } catch (Throwable t) {
102              fail("Can't instantiate " + cl + ": " + t);
103          }
104          return null; //Shut up compiler.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines