ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/Hashtable/IllegalLoadFactor.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/Hashtable/IllegalLoadFactor.java (file contents):
Revision 1.3 by jsr166, Sun Sep 5 21:32:19 2010 UTC vs.
Revision 1.4 by jsr166, Sat Oct 16 16:00:28 2010 UTC

# Line 38 | Line 38 | public class IllegalLoadFactor {
38  
39        public static void main(String argv[]) throws Exception {
40            boolean testSucceeded = false;
41 <          try{
41 >          try {
42                // this should generate an IllegalArgumentException
43                Hashtable bad1 = new Hashtable(100, -3);
44            }
# Line 49 | Line 49 | public class IllegalLoadFactor {
49                throw new Exception("Hashtable, negative load factor");
50  
51            testSucceeded = false;
52 <          try{
52 >          try {
53                // this should generate an IllegalArgumentException
54                Hashtable bad1 = new Hashtable(100, Float.NaN);
55            }
# Line 60 | Line 60 | public class IllegalLoadFactor {
60                throw new Exception("Hashtable, NaN load factor");
61  
62            testSucceeded = false;
63 <          try{
63 >          try {
64                // this should generate an IllegalArgumentException
65                HashMap bad1 = new HashMap(100, -3);
66            }
# Line 71 | Line 71 | public class IllegalLoadFactor {
71                throw new Exception("HashMap, negative load factor");
72  
73            testSucceeded = false;
74 <          try{
74 >          try {
75                // this should generate an IllegalArgumentException
76                HashMap bad1 = new HashMap(100, Float.NaN);
77            }
# Line 83 | Line 83 | public class IllegalLoadFactor {
83  
84  
85            testSucceeded = false;
86 <          try{
86 >          try {
87                // this should generate an IllegalArgumentException
88                HashSet bad1 = new HashSet(100, -3);
89            }
# Line 94 | Line 94 | public class IllegalLoadFactor {
94                throw new Exception("HashSet, negative load factor");
95  
96            testSucceeded = false;
97 <          try{
97 >          try {
98                // this should generate an IllegalArgumentException
99                HashSet bad1 = new HashSet(100, Float.NaN);
100            }
# Line 105 | Line 105 | public class IllegalLoadFactor {
105                throw new Exception("HashSet, NaN load factor");
106  
107            testSucceeded = false;
108 <          try{
108 >          try {
109                // this should generate an IllegalArgumentException
110                WeakHashMap bad1 = new WeakHashMap(100, -3);
111            }
# Line 116 | Line 116 | public class IllegalLoadFactor {
116                throw new Exception("WeakHashMap, negative load factor");
117  
118            testSucceeded = false;
119 <          try{
119 >          try {
120                // this should generate an IllegalArgumentException
121                WeakHashMap bad1 = new WeakHashMap(100, Float.NaN);
122            }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines