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.2 by jsr166, Wed Sep 1 20:12:39 2010 UTC vs.
Revision 1.4 by jsr166, Sat Oct 16 16:00:28 2010 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright 1997-1998 Sun Microsystems, Inc.  All Rights Reserved.
2 > * Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5   * This code is free software; you can redistribute it and/or modify it
# Line 16 | Line 16
16   * 2 along with this work; if not, write to the Free Software Foundation,
17   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18   *
19 < * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 < * CA 95054 USA or visit www.sun.com if you need additional information or
21 < * have any questions.
19 > * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 > * or visit www.oracle.com if you need additional information or have any
21 > * questions.
22   */
23  
24   /* @test
# 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