8219561: Update jdeprscan to avoid the need for start-of-release changes
Reviewed-by: dfuchs, lancea, smarks
--- a/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java Mon Feb 25 08:16:20 2019 -0800
+++ b/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java Mon Feb 25 14:45:29 2019 -0800
@@ -45,6 +45,8 @@
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.Queue;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import java.util.jar.JarEntry;
@@ -106,7 +108,10 @@
// Keep these updated manually until there's a compiler API
// that allows querying of supported releases.
final Set<String> releasesWithoutForRemoval = Set.of("6", "7", "8");
- final Set<String> releasesWithForRemoval = Set.of("9", "10", "11", "12", "13");
+ final Set<String> releasesWithForRemoval = // "9", "10", "11", ...
+ IntStream.rangeClosed(9, Runtime.version().feature())
+ .mapToObj(Integer::toString)
+ .collect(Collectors.toUnmodifiableSet());
final Set<String> validReleases;
{