Make determination of execution environment compliance generic#750
Make determination of execution environment compliance generic#750iloveeclipse merged 1 commit intoeclipse-jdt:masterfrom
Conversation
Currently one needs to add a new if for each new java version while the value is only matched against the number in the string. This now uses a pattern and check the result is larger than Java 1.8 version and then returns the number as a string so it automatically adapt to new java versions.
|
From all that I can see, this will only facilitate future maintenance, it doesn't add any new capability, right? |
Yes it should just prevent from adding more and more if cases for each Java version. Beside that before if it can not match any version Java 1.3 was returned (even though that is already checked before) what seems wrong or at least questionable, maybe the intend was to then use the lowest supported version (what would be 1.8 these days) but for new versions it seems really odd. Now if not a version can extracted and none of the versions match 1.0 is returned, what should never be hit anyways as we just have a generic pattern.
At least it is important for PDE and completely breaks the resolution of JVM packages see for example here for Java 23: and the same happened just yesterday with Java 25: because new java versions are added regularly I think it is valuable to reduce the amount of required manual changes as low as possible (at best one would only need to add support in compiler). |
Currently one needs to add a new if for each new java version while the value is only matched against the number in the string.
This now uses a pattern and check the result is larger than Java 1.8 version and then returns the number as a string so it automatically adapt to new java versions.