test/tools/javac/processing/werror/WErrorLast.java
Print this page
*** 22,31 ****
--- 22,33 ----
*/
/*
* @test 6403456
* @summary -Werror should work with annotation processing
+ * @library ../../lib
+ * @build JavacTestingAbstractProcessor
* @compile WErrorLast.java
* @compile -proc:only -processor WErrorLast WErrorLast.java
* @compile/fail/ref=WErrorLast.out -XDrawDiagnostics -Werror -proc:only -processor WErrorLast WErrorLast.java
*/
*** 34,55 ****
import javax.annotation.processing.*;
import javax.lang.model.*;
import javax.lang.model.element.*;
import javax.tools.*;
! @SupportedAnnotationTypes("*")
! public class WErrorLast extends AbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
- Messager messager = processingEnv.getMessager();
if (roundEnv.processingOver()) {
messager.printMessage(Diagnostic.Kind.WARNING, "last round");
}
return true;
}
-
- @Override
- public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.latest();
- }
}
--- 36,50 ----
import javax.annotation.processing.*;
import javax.lang.model.*;
import javax.lang.model.element.*;
import javax.tools.*;
! public class WErrorLast extends JavacTestingAbstractProcessor {
@Override
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
if (roundEnv.processingOver()) {
messager.printMessage(Diagnostic.Kind.WARNING, "last round");
}
return true;
}
}