10
|
1 |
/*
|
|
2 |
* @test /nodynamiccopyright/
|
|
3 |
* @bug 6362067
|
|
4 |
* @summary Messager methods do not print out source position information
|
|
5 |
* @build T6362067
|
|
6 |
* @compile -processor T6362067 -proc:only T6362067.java
|
|
7 |
* @compile/ref=T6362067.out -XDstdout -XDrawDiagnostics -processor T6362067 -proc:only T6362067.java
|
|
8 |
*/
|
|
9 |
|
|
10 |
import java.util.Set;
|
|
11 |
import javax.annotation.processing.*;
|
|
12 |
import javax.lang.model.element.*;
|
|
13 |
import static javax.tools.Diagnostic.Kind.*;
|
|
14 |
|
|
15 |
@Deprecated // convenient test annotation
|
|
16 |
@SupportedAnnotationTypes("*")
|
|
17 |
public class T6362067 extends AbstractProcessor {
|
|
18 |
public boolean process(Set<? extends TypeElement> annos,
|
|
19 |
RoundEnvironment roundEnv) {
|
|
20 |
Messager msgr = processingEnv.getMessager();
|
|
21 |
for (Element e: roundEnv.getRootElements()) {
|
|
22 |
msgr.printMessage(NOTE, "note:elem", e);
|
|
23 |
for (AnnotationMirror a: e.getAnnotationMirrors()) {
|
|
24 |
msgr.printMessage(NOTE, "note:anno", e, a);
|
|
25 |
for (AnnotationValue v: a.getElementValues().values()) {
|
|
26 |
msgr.printMessage(NOTE, "note:value", e, a, v);
|
|
27 |
}
|
|
28 |
|
|
29 |
}
|
|
30 |
}
|
|
31 |
if (roundEnv.processingOver())
|
|
32 |
msgr.printMessage(NOTE, "note:nopos");
|
|
33 |
return true;
|
|
34 |
}
|
|
35 |
|
|
36 |
@Override
|
|
37 |
public javax.lang.model.SourceVersion getSupportedSourceVersion() {
|
|
38 |
return javax.lang.model.SourceVersion.latest();
|
|
39 |
}
|
|
40 |
}
|