test/tools/javac/processing/filer/TestLastRound.java

Fri, 21 Dec 2012 08:45:43 -0800

author
darcy
date
Fri, 21 Dec 2012 08:45:43 -0800
changeset 1466
b52a38d4536c
parent 699
d2aaaec153e8
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8005282: Use @library tag with non-relative path for javac tests
Reviewed-by: jjg

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

mercurial