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

Add fallback to Thread Context Class Loader for resource loading #1969

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

mimkorn
Copy link

@mimkorn mimkorn commented Aug 29, 2023

This commit adds a fallback to Thread.currentThread().getContextClassLoader().getResourceAsStream(file) in the ClasspathHelper class.

Previously, if the ClasspathHelper.class.getResourceAsStream(file) and ClassLoader.getSystemResourceAsStream(file) methods returned null, no further attempts were made to load the resource, which caused issues in Quarkus applications in dev mode.

This commit adds an additional fallback to Thread.currentThread().getContextClassLoader().getResourceAsStream(file) to improve compatibility with the Quarkus class loading model.

Related Issue: #1968

This commit adds a fallback to `Thread.currentThread().getContextClassLoader().getResourceAsStream(file)` in the `ClasspathHelper` class.

Previously, if the `ClasspathHelper.class.getResourceAsStream(file)` and `ClassLoader.getSystemResourceAsStream(file)` methods returned `null`, no further attempts were made to load the resource, which caused issues in Quarkus applications in dev mode.

This commit adds an additional fallback to `Thread.currentThread().getContextClassLoader().getResourceAsStream(file)` to improve compatibility with the Quarkus class loading model.

Related Issue: swagger-api#1968
@gracekarina gracekarina merged commit 03238c7 into swagger-api:master Sep 20, 2023
5 checks passed
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.

2 participants