jjg@614: /* jjg@614: * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. jjg@614: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. jjg@614: * jjg@614: * This code is free software; you can redistribute it and/or modify it jjg@614: * under the terms of the GNU General Public License version 2 only, as jjg@614: * published by the Free Software Foundation. jjg@614: * jjg@614: * This code is distributed in the hope that it will be useful, but WITHOUT jjg@614: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or jjg@614: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License jjg@614: * version 2 for more details (a copy is included in the LICENSE file that jjg@614: * accompanied this code). jjg@614: * jjg@614: * You should have received a copy of the GNU General Public License version jjg@614: * 2 along with this work; if not, write to the Free Software Foundation, jjg@614: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. jjg@614: * jjg@614: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA jjg@614: * or visit www.oracle.com if you need additional information or have any jjg@614: * questions. jjg@614: */ jjg@614: jjg@614: /* jjg@614: * @test 6403456 jjg@614: * @summary -Werror should work with annotation processing darcy@1466: * @library /tools/javac/lib darcy@699: * @build JavacTestingAbstractProcessor jjg@614: * @compile WErrorLast.java jjg@614: * @compile -proc:only -processor WErrorLast WErrorLast.java jjg@614: * @compile/fail/ref=WErrorLast.out -XDrawDiagnostics -Werror -proc:only -processor WErrorLast WErrorLast.java jjg@614: */ jjg@614: jjg@614: import java.io.*; jjg@614: import java.util.*; jjg@614: import javax.annotation.processing.*; jjg@614: import javax.lang.model.*; jjg@614: import javax.lang.model.element.*; jjg@614: import javax.tools.*; jjg@614: darcy@699: public class WErrorLast extends JavacTestingAbstractProcessor { jjg@614: @Override jjg@614: public boolean process(Set annotations, jjg@614: RoundEnvironment roundEnv) { jjg@614: if (roundEnv.processingOver()) { jjg@614: messager.printMessage(Diagnostic.Kind.WARNING, "last round"); jjg@614: } jjg@614: return true; jjg@614: } jjg@614: }