guillaumecle commented on code in PR #17274:
URL: https://github.com/apache/beam/pull/17274#discussion_r927975021
##########
runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/Environments.java:
##########
@@ -112,6 +116,20 @@ public String specification() {
}
public static JavaVersion forSpecification(String specification) {
+ for (JavaVersion ver : JavaVersion.values()) {
+ if (ver.specification.equals(specification)) {
+ return ver;
+ }
+ }
+ JavaVersion fallback = java11;
Review Comment:
I can see 2 strategies:
1. find the absolute nearest. lower or higher
2. find the nearest higher. if you have code compile in java 13 you can hope
to have it working on java 17 but certainly not on java 11
It's still possible to have compiled your code with 11 but run it on java 13
jvm. this is why solution 1 can work and I'm going with it for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]