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

Fix ClasspathResolver for non-context class loader case #302

Merged
merged 1 commit into from
May 2, 2024

Conversation

ianlevesque
Copy link
Contributor

Broke the case where the context class loader can't actually find the resource and the fallback has to be used. Also added a test case to catch this specific regression.

Broke the case where the context class loader can't actually find the resource and the fallback has to be used. Also added a test case to catch this specific regression.
ianlevesque referenced this pull request May 2, 2024
We run mustache with huge parallelism in buck2 and as described in https://issuetracker.google.com/issues/137929327 and https://bugs.openjdk.java.net/browse/JDK-8205976 using getResourceAsStream can sometimes be not thread-safe, such as when used with URLClassLoader.

This applies the suggested workaround, which resolves the issue.
@spullara spullara merged commit adb82eb into spullara:main May 2, 2024
@spullara
Copy link
Owner

spullara commented May 2, 2024

Thanks!

@ianlevesque ianlevesque deleted the bugfixclassloader branch May 2, 2024 00:49
@spullara
Copy link
Owner

spullara commented May 2, 2024

I was suspicious about the if/else statement but I didn't want to hold up the pull for updating it with braces. Next time.

@ianlevesque
Copy link
Contributor Author

Yeah indeed. Years and years of google-java-format and ktfmt (both of which strictly require braces everywhere) have made me too used to it, but I didn't want to reformat the file or anything.

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