jdk/test/java/util/ResourceBundle/Bug4168625Class.java
changeset 2 90ce3da70b43
child 5285 7a74a8db7ef3
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 /*
       
     2  * Copyright (c) 2007 Sun Microsystems, Inc.  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
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.
       
     8  *
       
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    12  * version 2 for more details (a copy is included in the LICENSE file that
       
    13  * accompanied this code).
       
    14  *
       
    15  * You should have received a copy of the GNU General Public License version
       
    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.
       
    22  */
       
    23 /*
       
    24  *
       
    25  *
       
    26  * (C) Copyright IBM Corp. 1999 - All Rights Reserved
       
    27  *
       
    28  * Portions Copyright 2007 by Sun Microsystems, Inc.,
       
    29  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
       
    30  * All rights reserved.
       
    31  *
       
    32  * This software is the confidential and proprietary information
       
    33  * of Sun Microsystems, Inc. ("Confidential Information").  You
       
    34  * shall not disclose such Confidential Information and shall use
       
    35  * it only in accordance with the terms of the license agreement
       
    36  * you entered into with Sun.
       
    37  *
       
    38  * The original version of this source code and documentation is
       
    39  * copyrighted and owned by IBM. These materials are provided
       
    40  * under terms of a License Agreement between IBM and Sun.
       
    41  * This technology is protected by multiple US and International
       
    42  * patents. This notice and attribution to IBM may not be removed.
       
    43  *
       
    44  */
       
    45 import java.util.ResourceBundle;
       
    46 import java.util.MissingResourceException;
       
    47 import java.util.Locale;
       
    48 
       
    49 /**
       
    50  * Class loaded by custom class loader to load resources.
       
    51  * This call is called through the ResourceGetter interface
       
    52  * by the test.  The ResourceGetter interface is loaded
       
    53  * by the system loader to avoid ClassCastsExceptions.
       
    54  */
       
    55 public class Bug4168625Class implements Bug4168625Getter {
       
    56         /** return the specified resource or null if not found */
       
    57     public ResourceBundle getResourceBundle(String resource, Locale locale) {
       
    58         try {
       
    59             return ResourceBundle.getBundle(resource, locale);
       
    60         } catch (MissingResourceException e) {
       
    61             return null;
       
    62         }
       
    63     }
       
    64 }