8219561: Update jdeprscan to avoid the need for start-of-release changes
authordarcy
Mon, 25 Feb 2019 14:45:29 -0800
changeset 53915 7fec83061f24
parent 53914 ee4488381c78
child 53916 ca1a2ca32885
8219561: Update jdeprscan to avoid the need for start-of-release changes Reviewed-by: dfuchs, lancea, smarks
src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/Main.java
--- 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;
     {