0N/A/*
553N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/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.
0N/A */
0N/A
0N/A/*
0N/A * @test
0N/A * @bug 6395974
0N/A * @summary files are parsed even after failure to find annotation processor is reported
0N/A */
0N/A
0N/Aimport java.io.*;
0N/Aimport java.util.*;
0N/Aimport javax.tools.*;
0N/Aimport com.sun.source.util.*;
0N/Aimport com.sun.tools.javac.api.*;
0N/A
0N/A
0N/Apublic class T6395974 {
0N/A public static void main(String... args) throws Throwable {
0N/A String self = T6395974.class.getName();
0N/A
0N/A String testSrc = System.getProperty("test.src");
0N/A
0N/A JavacTool tool = JavacTool.create();
0N/A StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
0N/A Iterable<?extends JavaFileObject> f =
0N/A fm.getJavaFileObjectsFromFiles(Arrays.asList(new File(testSrc, self + ".java")));
0N/A
0N/A PrintWriter out = new PrintWriter(System.err, true);
0N/A
0N/A JavacTaskImpl task = (JavacTaskImpl) tool.getTask(out,
0N/A fm,
0N/A null,
0N/A Arrays.asList("-processor",
0N/A "Foo.java"),
0N/A null,
0N/A f);
0N/A
0N/A MyTaskListener tl = new MyTaskListener();
0N/A task.setTaskListener(tl);
0N/A
0N/A task.call();
0N/A
0N/A if (tl.event != null)
0N/A throw new AssertionError("Unexpected TaskListener event: " + tl.event);
0N/A }
0N/A
0N/A static class MyTaskListener implements TaskListener {
0N/A public void started(TaskEvent e) {
0N/A System.err.println("Started: " + e);
0N/A if (event == null)
0N/A event = e;
0N/A }
0N/A public void finished(TaskEvent e) {
0N/A }
0N/A
0N/A TaskEvent event;
0N/A }
0N/A}