Conversation
Before this change, the VirtualFileSystem was using a `Class` as a beacon to find resources. I suppose that the intent was to use `Class#getResource`, but in practice, it's always `clazz.getClassLoader().getResource()` which is used, which makes it redundant to use a class. This commit refactors the code to allow declaring which _classloader_ to use for loading. This is important because in some cases, we don't necessarily have a `Class` to pass, but we _do_ have a classloader. This should also allow more advanced scenarios with filtering classloaders for example. Since the `Class` was actually never directly used, but only its classloader, this change should have 0 impact for backwards compatibility.
|
FYI: what failed is |
|
I don't know what's going on with the integration (macos-latest, test_jbang_integration.py). I don't think it's anything introduced in this PR. The MacOS runners tend to have issues with memory limits when building native images, so they do fail transiently. Another PR just passed this check recently. If this is the last issue with this PR, we can consider disabling the native image build in that test when running on MacOS -- I was contemplating that for a some time already. Btw. this log file would help us: some time ago I was trying to convince |
Description
Before this change, the VirtualFileSystem was using a
Classas a beacon to find resources. I suppose that the intent was to useClass#getResource, but in practice, it's alwaysclazz.getClassLoader().getResource()which is used, which makes it redundant to use a class. This commit refactors the code to allow declaring which classloader to use for loading. This is important because in some cases, we don't necessarily have aClassto pass, but we do have a classloader. This should also allow more advanced scenarios with filtering classloaders for example.Since the
Classwas actually never directly used, but only its classloader, this change should have 0 impact for backwards compatibility.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: