# HG changeset patch # User smarks # Date 1529977770 25200 # Node ID cf0898a6441ec191974edb702b3121cea50a68e8 # Parent afbcf72c389d3bd82c6efc5cf0249287ef40b634 8205455: jdeprscan issues annotation processor warning regarding RELEASE_10 Reviewed-by: jjg diff -r afbcf72c389d -r cf0898a6441e src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java Mon Jun 25 18:01:42 2018 -0700 +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java Mon Jun 25 18:49:30 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ 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; import javax.lang.model.element.ExecutableElement; @@ -50,15 +51,12 @@ import javax.tools.Diagnostic; -import static javax.lang.model.SourceVersion.RELEASE_11; - /** * Annotation processor for the Deprecation Scanner tool. * Examines APIs for deprecated elements and records information * */ @SupportedAnnotationTypes("java.lang.Deprecated") -@SupportedSourceVersion(RELEASE_11) public class LoadProc extends AbstractProcessor { Elements elements; Messager messager; @@ -75,6 +73,11 @@ } @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { if (roundEnv.processingOver()) { return false; diff -r afbcf72c389d -r cf0898a6441e src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java --- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java Mon Jun 25 18:01:42 2018 -0700 +++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java Mon Jun 25 18:49:30 2018 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,18 +41,16 @@ import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedSourceVersion; -import javax.lang.model.element.ModuleElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; - -import static javax.lang.model.SourceVersion.RELEASE_10; +import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; +import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; import javax.tools.Diagnostic; -@SupportedSourceVersion(RELEASE_10) @SupportedAnnotationTypes("*") public class TraverseProc extends AbstractProcessor { Elements elements; @@ -72,6 +70,11 @@ } @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + @Override public boolean process(Set annotations, RoundEnvironment roundEnv) { if (roundEnv.processingOver()) { return false; diff -r afbcf72c389d -r cf0898a6441e test/langtools/tools/jdeprscan/tests/jdk/jdeprscan/TestRelease.java --- a/test/langtools/tools/jdeprscan/tests/jdk/jdeprscan/TestRelease.java Mon Jun 25 18:01:42 2018 -0700 +++ b/test/langtools/tools/jdeprscan/tests/jdk/jdeprscan/TestRelease.java Mon Jun 25 18:49:30 2018 -0700 @@ -44,7 +44,10 @@ public class TestRelease { static boolean invoke(String arg) { - return Main.call(System.out, System.err, "--list", "--release", arg); + System.err.println(">>> invoking Main.call with arguments: --list --release " + arg); + boolean r = Main.call(System.out, System.err, "--list", "--release", arg); + System.err.println(">>> Main.call returned " + r); + return r; } @Test