Skip to content

fix: fixed issue with linked() and real paths#110

Merged
quintesse merged 1 commit into
mainfrom
fix_realpath
Jun 14, 2026
Merged

fix: fixed issue with linked() and real paths#110
quintesse merged 1 commit into
mainfrom
fix_realpath

Conversation

@quintesse

@quintesse quintesse commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

The issue was that linked() calls toRealPath() on a Jdk's home path and then asks all providers which of them manages the Jdk that it points to, using a call to getInstalledByPath(). However, if the provider was intialized with a path that contains symlinks, it would not be able to find the Jdk, because the path it was initialized with would not match the real path. The soution was to call toRealPath() on the provider's path during initialization.

We only do this for providers that don't really care about or deal with links. Providers that specifically deal with links, like the "default" and "linked" providers, are left as-is.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0f376fe3-6e1c-479e-8f8c-8c688f72fc1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The issue was that `linked()` calls `toRealPath()` on a Jdk's home path and then
asks all providers which of them manages the Jdk that it points to, using
a call to `getInstalledByPath()`. However, if the provider was intialized with a
path that contains symlinks, it would not be able to find the Jdk, because the path
it was initialized with would not match the real path. The soution was to call
`toRealPath()` on the provider's path during initialization.
@quintesse quintesse merged commit 7e8963f into main Jun 14, 2026
8 checks passed
@quintesse quintesse deleted the fix_realpath branch June 14, 2026 21:14
@quintesse

Copy link
Copy Markdown
Contributor Author

In the end the solution was pretty similar to what your AI PR suggested, just a bit simpler. And at least I understand why this is a good solution at least :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant