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

Comparing jsr166/src/test/jtreg/util/Collections/WrappedNull.java (file contents):
Revision 1.1 by jsr166, Tue Sep 1 01:24:16 2009 UTC vs.
Revision 1.4 by jsr166, Sat Oct 16 16:00:28 2010 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright 1999 Sun Microsystems, Inc.  All Rights Reserved.
2 > * Copyright (c) 1999, 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   /*
# Line 33 | Line 33 | import java.util.*;
33   public class WrappedNull {
34        public static void main(String argv[]) throws Exception {
35            boolean testSucceeded = false;
36 <          try{
36 >          try {
37                List l = Arrays.asList(null);
38            }
39            catch (NullPointerException e) {
40                testSucceeded = true;
41            }
42 <          if(!testSucceeded)
42 >          if (!testSucceeded)
43                throw new Exception("Arrays.asList");
44  
45            testSucceeded = false;
46 <          try{
46 >          try {
47                Collection c = Collections.unmodifiableCollection(null);
48            }
49            catch (NullPointerException e) {
50                testSucceeded = true;
51            }
52 <          if(!testSucceeded)
52 >          if (!testSucceeded)
53                throw new Exception("unmodifiableCollection");
54  
55            testSucceeded = false;
56 <          try{
56 >          try {
57                Set c = Collections.unmodifiableSet(null);
58            }
59            catch (NullPointerException e) {
60                testSucceeded = true;
61            }
62 <          if(!testSucceeded)
62 >          if (!testSucceeded)
63                throw new Exception("unmodifiableSet");
64  
65            testSucceeded = false;
66 <          try{
66 >          try {
67                List c = Collections.unmodifiableList(null);
68            }
69            catch (NullPointerException e) {
70                testSucceeded = true;
71            }
72 <          if(!testSucceeded)
72 >          if (!testSucceeded)
73                throw new Exception("unmodifiableList");
74  
75            testSucceeded = false;
76 <          try{
76 >          try {
77                Map c = Collections.unmodifiableMap(null);
78            }
79            catch (NullPointerException e) {
80                testSucceeded = true;
81            }
82 <          if(!testSucceeded)
82 >          if (!testSucceeded)
83                throw new Exception("unmodifiableMap");
84  
85            testSucceeded = false;
86 <          try{
86 >          try {
87                SortedSet c = Collections.unmodifiableSortedSet(null);
88            }
89            catch (NullPointerException e) {
90                testSucceeded = true;
91            }
92 <          if(!testSucceeded)
92 >          if (!testSucceeded)
93                throw new Exception("unmodifiableSortedSet");
94  
95            testSucceeded = false;
96 <          try{
96 >          try {
97                SortedMap c = Collections.unmodifiableSortedMap(null);
98            }
99            catch (NullPointerException e) {
100                testSucceeded = true;
101            }
102 <          if(!testSucceeded)
102 >          if (!testSucceeded)
103                throw new Exception("unmodifiableSortedMap");
104  
105            testSucceeded = false;
106 <          try{
106 >          try {
107                Collection c = Collections.synchronizedCollection(null);
108            }
109            catch (NullPointerException e) {
110                testSucceeded = true;
111            }
112 <          if(!testSucceeded)
112 >          if (!testSucceeded)
113                throw new Exception("synchronizedCollection");
114  
115            testSucceeded = false;
116 <          try{
116 >          try {
117                Set c = Collections.synchronizedSet(null);
118            }
119            catch (NullPointerException e) {
120                testSucceeded = true;
121            }
122 <          if(!testSucceeded)
122 >          if (!testSucceeded)
123                throw new Exception("synchronizedSet");
124  
125            testSucceeded = false;
126 <          try{
126 >          try {
127                List c = Collections.synchronizedList(null);
128            }
129            catch (NullPointerException e) {
130                testSucceeded = true;
131            }
132 <          if(!testSucceeded)
132 >          if (!testSucceeded)
133                throw new Exception("synchronizedList");
134  
135            testSucceeded = false;
136 <          try{
136 >          try {
137                Map c = Collections.synchronizedMap(null);
138            }
139            catch (NullPointerException e) {
140                testSucceeded = true;
141            }
142 <          if(!testSucceeded)
142 >          if (!testSucceeded)
143                throw new Exception("synchronizedMap");
144  
145            testSucceeded = false;
146 <          try{
146 >          try {
147                SortedSet c = Collections.synchronizedSortedSet(null);
148            }
149            catch (NullPointerException e) {
150                testSucceeded = true;
151            }
152 <          if(!testSucceeded)
152 >          if (!testSucceeded)
153                throw new Exception("synchronizedSortedSet");
154  
155            testSucceeded = false;
156 <          try{
156 >          try {
157                SortedMap c = Collections.synchronizedSortedMap(null);
158            }
159            catch (NullPointerException e) {
160                testSucceeded = true;
161            }
162 <          if(!testSucceeded)
162 >          if (!testSucceeded)
163                throw new Exception("synchronizedSortedMap");
164  
165            // Make sure that non-null arguments don't throw exc.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines