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 |
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 |
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 |
|
} |
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 |
|
} |
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 |
|
} |
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 |
|
} |
83 |
|
|
84 |
|
|
85 |
|
testSucceeded = false; |
86 |
< |
try{ |
86 |
> |
try { |
87 |
|
// this should generate an IllegalArgumentException |
88 |
|
HashSet bad1 = new HashSet(100, -3); |
89 |
|
} |
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 |
|
} |
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 |
|
} |
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 |
|
} |