fix: resolve SdkmanJdkProvider folder resolution#96
Conversation
3e6961e to
be6f28b
Compare
quintesse
left a comment
There was a problem hiding this comment.
Hi @ayagmar , thanks for your PR!
I haven't had time to take a good look but I'm fairly positive this approach is the wrong one. If the BaseFoldersJdkProvider is rejecting the folders because they don't follow the normal naming it expects then the typical thing to do is override the acceptFolder() method to use an implementation that works for this particular use-case.
I'm actually guessing that an earlier base implementation didn't check for the suffix on the end of folder names so it just accepted all of them. And then later that got changed and nobody noticed because there were no tests and sdkman wasn't part of the standard set of providers.
But you can look at the implementations of Linux- Mise- and ScoopJdkProvider to see how they do it.
If you can make that change I'll happily accept your PR .
|
Hey @quintesse Edit: Done I simplified resolution and also squashed the other commits to reduce noise |
cac279e to
3da7c1a
Compare
3da7c1a to
18c4cc4
Compare
|
Perfect. Thanks @ayagmar |
Fix SDKMAN JDK detection for normal SDKMAN folder names
--jdk-providers=sdkmancould fail to find installed JDKs like25.0.1-tem/25.0.2-zuluect..Note
If multiple installed SDKMAN JDKs match a requested major version, selection is now deterministic.
For open major requests (for example
21+), it selects the lowest matching major and the newest patch within that major.For exact major requests (for example
21), it selects the newest patch within that major.Validation
Fixes #95