fix: restore multi-JDK features lost in aesh migration#2513
Conversation
PR jbangdev#2271 (feat: install multiple JDKs with same major version) was merged on May 14, but its features were partially lost when PR jbangdev#2453 (aesh migration) was squash-merged on June 3. Restored features in Jdk.java: - jdk list --providers/-P to list available JDK providers - jdk list --distros/-D to list available JDK distributions - Full version comparison (defVersion string) instead of majorVersion int, so default marker works with multiple JDKs of same major version - Separate available/installed JDK mapping with LinkedJdk detection - Tag display in detailed text output - Available JDKs show jdk.id in non-detail mode - jdk uninstall two-pass: tries canInstall first, falls back to canUpdate, prints jdk.id() in info message - jdk java-env uses canInstall predicate Restored tests in TestJdk.java: - testJdkInstallWithLinkingAndIntegerId - testJdkInstallWithLinkingToExistingJBangJdkPath - testJdkInstallSameVersion - testJdkInstallSameVersionForced
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@quintesse this is result after asking opus to investigate what features/fixes from #2271 got lost in aesh port. does it look right or I can also go back rebasing ash pr but that would be much bigger diff I fear. |
|
I already wnet through it by hand but I'll check it against this to see if either of us missed anything |
|
related to #2515 |
Problem
PR #2271 (feat: install multiple JDKs with same major version) was merged on May 14, but several of its features were lost when PR #2453 (aesh migration) was squash-merged on June 3. The aesh migration rewrote
Jdk.javafrom picocli to aesh annotations but didn't preserve all the behavioral changes from #2271.What was lost and is now restored
Jdk.java— 7 fixesjdk list --providers/-Pjdk list --distros/-DJdkDistroQueryimport droppeddefVersionstring)defMajorVersionint — breaks default marker with multiple JDKs of same major versionlinkedIdalways null, noLinkedJdkdetectionjdk uninstalltwo-pass (canInstall→canUpdate)canUpdate; info message uses raw input instead ofjdk.id()jdk java-envusescanInstallcanUpdateTestJdk.java— 4 restored teststestJdkInstallWithLinkingAndIntegerIdtestJdkInstallWithLinkingToExistingJBangJdkPathtestJdkInstallSameVersiontestJdkInstallSameVersionForced--forcecreates versioned dir + symlink (core multi-JDK feature)Verification
All 30 TestJdk tests pass (including the 4 restored ones), plus TestRun (124) and TestProject (9) — zero failures.