Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Separated JDK management code into its own module #1874

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

quintesse
Copy link
Contributor

Fixes #1857

@quintesse quintesse changed the title Separated JDK management code into its own module refactor: Separated JDK management code into its own module Nov 27, 2024
private static JdkManager jdkManager = null;

@Nonnull
public static JdkManager jdkManager() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we seem to call this in many places - but how is going to take into affect jbang provided config of i.e. providers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the idea is that the config gets used exactly in that file you're referencing. So the builder will use the config to initialize the jdk manager, including the providers. The jdk manager itself is then completely agnostic where its configuration comes from.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so in jbang cli we would not call jdkmanger() but have our own instance configured from jbang config?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this JavaUtil class is in the jbang CLI, so this code here is exactly where that instance using jbang config is created.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: If you look a bit lower in the createProvider() method you see it references config, which is the jbang config. The missing part I mentioned in our chat is exactly that: tying together the config with the instance creation :-)

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.

Refactor JDK management code into separate module
2 participants