langtools/test/tools/javac/7129225/AnnoProcessor.java
author jjh
Wed, 25 Jan 2012 12:20:05 -0800
changeset 11710 f435448e40fc
parent 11709 0d56d3fc22e6
child 32337 c9d3ab9f601c
permissions -rw-r--r--
7133314: The regression test for 7129225 fails when run with jtreg -samevm or jtreg -agentvm Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11709
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     1
/*
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     4
 *
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    10
 *
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    15
 * accompanied this code).
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    16
 *
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    20
 *
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    23
 * questions.
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    24
 */
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    25
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    26
import java.util.Set;
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    27
import javax.annotation.processing.*;
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    28
import javax.lang.model.SourceVersion;
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    29
import javax.lang.model.element.TypeElement;
11710
f435448e40fc 7133314: The regression test for 7129225 fails when run with jtreg -samevm or jtreg -agentvm
jjh
parents: 11709
diff changeset
    30
import javax.tools.Diagnostic.Kind;
11709
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    31
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    32
@SupportedAnnotationTypes("Anno")
11710
f435448e40fc 7133314: The regression test for 7129225 fails when run with jtreg -samevm or jtreg -agentvm
jjh
parents: 11709
diff changeset
    33
public class AnnoProcessor extends JavacTestingAbstractProcessor {
11709
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    34
    @Override
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    35
    public SourceVersion getSupportedSourceVersion() {
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    36
        return SourceVersion.latest();
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    37
    }
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    38
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    39
    @Override
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    40
    public boolean process(Set<? extends TypeElement> set, RoundEnvironment re) {
11710
f435448e40fc 7133314: The regression test for 7129225 fails when run with jtreg -samevm or jtreg -agentvm
jjh
parents: 11709
diff changeset
    41
        messager.printMessage(Kind.NOTE, "RUNNING - lastRound = " + re.processingOver());
11709
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    42
        return true;
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    43
    }
0d56d3fc22e6 7129225: javac fails to run annotation processors when star import of package of gensrc
jjh
parents:
diff changeset
    44
}
11710
f435448e40fc 7133314: The regression test for 7129225 fails when run with jtreg -samevm or jtreg -agentvm
jjh
parents: 11709
diff changeset
    45