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 :-)

@quintesse quintesse force-pushed the jdkman_lib branch 2 times, most recently from 8c7ba7e to 4489268 Compare November 28, 2024 19:44
@quintesse quintesse force-pushed the jdkman_lib branch 2 times, most recently from 2d66e04 to 21e1e5a Compare December 13, 2024 22:05
@quintesse quintesse force-pushed the jdkman_lib branch 5 times, most recently from 260870f to 0f35aa5 Compare January 13, 2025 17:42
@quintesse quintesse force-pushed the jdkman_lib branch 7 times, most recently from e0639c0 to f5e2bb3 Compare January 27, 2025 19:56
@quintesse quintesse force-pushed the jdkman_lib branch 3 times, most recently from e571e7f to c5c77e7 Compare January 30, 2025 12:16
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