提交 c6d3390d 编写于 作者: D Daniel Spilker 提交者: Oleg Nenashev

[JENKINS-32978] Support latest source version to avoid compile time warnings with JDK7 (#2032)

see http://stackoverflow.com/questions/8185331/forward-compatible-java-6-annotation-processor-and-supportedsourceversion
上级 c3a0c3b6
......@@ -30,7 +30,6 @@ import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Processor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
......@@ -54,7 +53,6 @@ import java.util.Set;
* @author Kohsuke Kawaguchi
* @since 1.420
*/
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
@MetaInfServices(Processor.class)
@SuppressWarnings({"Since15"})
......@@ -80,6 +78,11 @@ public class PluginSubtypeMarker extends AbstractProcessor {
return super.visitType(e, aVoid);
}
@Override
public Void visitUnknown(Element e, Void aVoid) {
return DEFAULT_VALUE;
}
};
for (Element e : roundEnv.getRootElements()) {
......@@ -100,6 +103,11 @@ public class PluginSubtypeMarker extends AbstractProcessor {
}
}
@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}
private void write(TypeElement c) throws IOException {
FileObject f = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT,
"", "META-INF/services/hudson.Plugin");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册