6N/A/*
553N/A * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
6N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6N/A *
6N/A * This code is free software; you can redistribute it and/or modify it
6N/A * under the terms of the GNU General Public License version 2 only, as
6N/A * published by the Free Software Foundation.
6N/A *
6N/A * This code is distributed in the hope that it will be useful, but WITHOUT
6N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6N/A * version 2 for more details (a copy is included in the LICENSE file that
6N/A * accompanied this code).
6N/A *
6N/A * You should have received a copy of the GNU General Public License version
6N/A * 2 along with this work; if not, write to the Free Software Foundation,
6N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
6N/A */
6N/A
6N/A/*
6N/A * @test
6N/A * @bug 6608214
6N/A * @summary Exception throw while analysing a file with error
6N/A * @author Maurizio Cimadamore
6N/A */
6N/A
6N/Aimport com.sun.source.util.JavacTask;
6N/Aimport java.io.IOException;
6N/Aimport java.net.URI;
6N/Aimport java.util.Arrays;
6N/Aimport java.util.List;
6N/Aimport javax.tools.JavaCompiler;
6N/Aimport javax.tools.JavaFileObject;
6N/Aimport javax.tools.SimpleJavaFileObject;
6N/Aimport javax.tools.ToolProvider;
6N/Aimport static javax.tools.JavaFileObject.Kind;
6N/A
6N/Apublic class T6608214 {
6N/A public static void main(String[] args) throws IOException {
6N/A JavaFileObject sfo = new SimpleJavaFileObject(URI.create(""),Kind.SOURCE) {
6N/A public CharSequence getCharContent(boolean ignoreEncodingErrors) {
6N/A return "class Test<S> { <T extends S & Runnable> void test(){}}";
6N/A }
6N/A };
6N/A List<? extends JavaFileObject> files = Arrays.asList(sfo);
6N/A String bootPath = System.getProperty("sun.boot.class.path");
6N/A List<String> opts = Arrays.asList("-bootclasspath", bootPath, "-Xjcov");
6N/A JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
6N/A JavacTask ct = (JavacTask)tool.getTask(null, null, null,opts,null,files);
6N/A ct.analyze();
6N/A }
6N/A}