Mon, 23 Sep 2013 17:27:38 +0400
7154966: CRs found to be in Fixed state with no test and no noreg- keyword.
Reviewed-by: ksrini
jjg@614 | 1 | /* |
jjg@614 | 2 | * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
jjg@614 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jjg@614 | 4 | * |
jjg@614 | 5 | * This code is free software; you can redistribute it and/or modify it |
jjg@614 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jjg@614 | 7 | * published by the Free Software Foundation. |
jjg@614 | 8 | * |
jjg@614 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jjg@614 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jjg@614 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jjg@614 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jjg@614 | 13 | * accompanied this code). |
jjg@614 | 14 | * |
jjg@614 | 15 | * You should have received a copy of the GNU General Public License version |
jjg@614 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jjg@614 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jjg@614 | 18 | * |
jjg@614 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jjg@614 | 20 | * or visit www.oracle.com if you need additional information or have any |
jjg@614 | 21 | * questions. |
jjg@614 | 22 | */ |
jjg@614 | 23 | |
jjg@614 | 24 | /* |
jjg@614 | 25 | * @test 6403456 |
jjg@614 | 26 | * @summary -Werror should work with annotation processing |
darcy@1466 | 27 | * @library /tools/javac/lib |
darcy@699 | 28 | * @build JavacTestingAbstractProcessor |
jjg@614 | 29 | * @compile WErrorGen.java |
jjg@614 | 30 | * @compile -proc:only -processor WErrorGen WErrorGen.java |
jjg@614 | 31 | * @compile/fail/ref=WErrorGen.out -XDrawDiagnostics -Werror -Xlint:rawtypes -processor WErrorGen WErrorGen.java |
jjg@614 | 32 | */ |
jjg@614 | 33 | |
jjg@614 | 34 | import java.io.*; |
jjg@614 | 35 | import java.util.*; |
jjg@614 | 36 | import javax.annotation.processing.*; |
jjg@614 | 37 | import javax.lang.model.*; |
jjg@614 | 38 | import javax.lang.model.element.*; |
jjg@614 | 39 | import javax.tools.*; |
jjg@614 | 40 | |
darcy@699 | 41 | public class WErrorGen extends JavacTestingAbstractProcessor { |
jjg@614 | 42 | @Override |
jjg@614 | 43 | public boolean process(Set<? extends TypeElement> annotations, |
jjg@614 | 44 | RoundEnvironment roundEnv) { |
jjg@620 | 45 | if (++round == 1) { |
jjg@614 | 46 | try { |
jjg@614 | 47 | JavaFileObject fo = filer.createSourceFile("Gen"); |
jjg@614 | 48 | Writer out = fo.openWriter(); |
jjg@614 | 49 | out.write("import java.util.*; class Gen { List l; }"); |
jjg@614 | 50 | out.close(); |
jjg@614 | 51 | } catch (IOException e) { |
jjg@614 | 52 | } |
jjg@614 | 53 | } |
jjg@614 | 54 | return true; |
jjg@614 | 55 | } |
jjg@614 | 56 | |
jjg@620 | 57 | int round = 0; |
jjg@614 | 58 | } |