CheckedNull.java revision 1771
2740N/A * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 2740N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2740N/A * This code is free software; you can redistribute it and/or modify it 2740N/A * under the terms of the GNU General Public License version 2 only, as 2740N/A * published by the Free Software Foundation. 2740N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2740N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2740N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2740N/A * version 2 for more details (a copy is included in the LICENSE file that 2740N/A * You should have received a copy of the GNU General Public License version 2740N/A * 2 along with this work; if not, write to the Free Software Foundation, 2740N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2740N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2740N/A * CA 95054 USA or visit www.sun.com if you need additional information or 2740N/A * @summary Test behavior of nulls in checked collections new F(){
void f(){ c.
add(
1); }},
new F(){
void f(){ m.
put(
1,
"foo"); }},
new F(){
void f(){ m.
put(
"foo",
1); }},
new F(){
void f(){ m.
put(
3,
1); }},
//--------------------- Infrastructure --------------------------- else fail(x +
" not equal to " + y);}
abstract class F {
abstract void f()
throws Throwable;}