eclipse / microprofile-starter

MicroProfile project generator source code
Apache License 2.0
74 stars 51 forks source link

Population of SE drop list is incorrect with certain combinations #479

Closed tjquinno closed 1 year ago

tjquinno commented 1 year ago

Currently JDKSelector#fillJavaSEVersion adds a candidate SE version to a supported server's drop list for a given MP version if either the minimum MP version qualifies or the maximum MP version qualifies.

The logic should require both conditions to be true.

You can see this by temporarily adding an entry for SE17 to JavaSEVersion and then changing JDKSelector so a server has three combinations of supported SE version (see diffs below). IIUC the revised JDKSelector should require SE 11 for Helidon supporting MP 3.2 and 3.3 and should require SE 17 for Helidon supporting MP 5.0. But if you build and run the starter with these changes, the SE drop list for Helidon/MP 5.0 incorrectly contains both 11 and 17.

diff --git a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java
index 3f6ecfa..4885363 100644
--- a/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java
+++ b/src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java
@@ -60,7 +60,8 @@ public class JDKSelector {
         fillJavaSEVersion(data, SupportedServer.TOMEE, JavaSEVersion.SE8, null, null);  // Supported for all MPVersions

         fillJavaSEVersion(data, SupportedServer.HELIDON, JavaSEVersion.SE8, null, MicroProfileVersion.MP30);  // Supported until MP 3.2
-        fillJavaSEVersion(data, SupportedServer.HELIDON, JavaSEVersion.SE11, MicroProfileVersion.MP32, null);  // Supported from MP 3.2
+        fillJavaSEVersion(data, SupportedServer.HELIDON, JavaSEVersion.SE11, MicroProfileVersion.MP32, MicroProfileVersion.MP33);
+        fillJavaSEVersion(data, SupportedServer.HELIDON, JavaSEVersion.SE17, MicroProfileVersion.MP50, null);

     }

diff --git a/src/main/java/org/eclipse/microprofile/starter/core/model/JavaSEVersion.java b/src/main/java/org/eclipse/microprofile/starter/core/model/JavaSEVersion.java
index ca0a813..235c49f 100755
--- a/src/main/java/org/eclipse/microprofile/starter/core/model/JavaSEVersion.java
+++ b/src/main/java/org/eclipse/microprofile/starter/core/model/JavaSEVersion.java
@@ -29,7 +29,8 @@ public enum JavaSEVersion implements ComboBoxItem {
     // @formatter:off
     NONE(null, ""),
     SE8("1.8", "Java 8"),
-    SE11("11", "Java 11");
+    SE11("11", "Java 11"),
+    SE17("17", "Java 17");
     // @formatter:on

     private String code;
tjquinno commented 1 year ago

@Karm @rdebusscher Any thoughts on this issue and the PR? Anyone else I should involve?