366N/A/*
366N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
366N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
366N/A *
366N/A * This code is free software; you can redistribute it and/or modify it
366N/A * under the terms of the GNU General Public License version 2 only, as
366N/A * published by the Free Software Foundation.
366N/A *
366N/A * This code is distributed in the hope that it will be useful, but WITHOUT
366N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
366N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
366N/A * version 2 for more details (a copy is included in the LICENSE file that
366N/A * accompanied this code).
366N/A *
366N/A * You should have received a copy of the GNU General Public License version
366N/A * 2 along with this work; if not, write to the Free Software Foundation,
366N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
366N/A *
366N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
366N/A * or visit www.oracle.com if you need additional information or have any
366N/A * questions.
366N/A */
366N/A
366N/A/*
366N/A * @test
366N/A * @bug 6400205
366N/A * @summary getClassLoader(location) returns null if getLocation(location) returns null
366N/A * @author Peter von der Ah\u00e9
366N/A */
366N/A
366N/Aimport javax.tools.*;
366N/Aimport static javax.tools.StandardLocation.*;
493N/A
366N/Apublic class T6400205 {
366N/A public static void main(String... args) {
366N/A JavaFileManager fm =
493N/A ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null);
366N/A try {
366N/A fm.getClassLoader(null);
493N/A throw new AssertionError("NullPointerException not thrown");
366N/A } catch (NullPointerException e) {
366N/A // expected result
366N/A }
366N/A ClassLoader cl = fm.getClassLoader(locationFor("bogus"));
366N/A if (cl != null)
366N/A throw new AssertionError("non-null class loader for bogus location");
366N/A System.err.println("Test PASSED.");
366N/A }
366N/A}
366N/A