Thu, 31 Aug 2017 15:17:03 +0800
merge
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * @test /nodynamiccopyright/ |
aoqi@0 | 3 | * @bug 6362067 |
aoqi@0 | 4 | * @summary Messager methods do not print out source position information |
aoqi@0 | 5 | * @library /tools/javac/lib |
aoqi@0 | 6 | * @build JavacTestingAbstractProcessor T6362067 |
aoqi@0 | 7 | * @compile -processor T6362067 -proc:only T6362067.java |
aoqi@0 | 8 | * @compile/ref=T6362067.out -XDrawDiagnostics -processor T6362067 -proc:only T6362067.java |
aoqi@0 | 9 | */ |
aoqi@0 | 10 | import java.util.Set; |
aoqi@0 | 11 | import javax.annotation.processing.*; |
aoqi@0 | 12 | import javax.lang.model.element.*; |
aoqi@0 | 13 | import static javax.tools.Diagnostic.Kind.*; |
aoqi@0 | 14 | |
aoqi@0 | 15 | @Deprecated // convenient test annotations |
aoqi@0 | 16 | @SuppressWarnings({""}) |
aoqi@0 | 17 | public class T6362067 extends JavacTestingAbstractProcessor { |
aoqi@0 | 18 | public boolean process(Set<? extends TypeElement> annos, |
aoqi@0 | 19 | RoundEnvironment roundEnv) { |
aoqi@0 | 20 | |
aoqi@0 | 21 | for (Element e: roundEnv.getRootElements()) { |
aoqi@0 | 22 | messager.printMessage(NOTE, "note:elem", e); |
aoqi@0 | 23 | for (AnnotationMirror a: e.getAnnotationMirrors()) { |
aoqi@0 | 24 | messager.printMessage(NOTE, "note:anno", e, a); |
aoqi@0 | 25 | for (AnnotationValue v: a.getElementValues().values()) { |
aoqi@0 | 26 | messager.printMessage(NOTE, "note:value", e, a, v); |
aoqi@0 | 27 | } |
aoqi@0 | 28 | } |
aoqi@0 | 29 | } |
aoqi@0 | 30 | |
aoqi@0 | 31 | if (roundEnv.processingOver()) |
aoqi@0 | 32 | messager.printMessage(NOTE, "note:nopos"); |
aoqi@0 | 33 | return true; |
aoqi@0 | 34 | } |
aoqi@0 | 35 | } |