Repository navigation
Handle a null context classloader when resolving templates - #316
Open
illusionoftalha wants to merge 1 commit into
Open
illusionoftalha wants to merge 1 commit into
illusionoftalha wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #277.
ClasspathResolver.getReaderdereferences the thread context classloader even when it is null. A context classloader with no matching resource already falls back to the resolver's defining classloader; use that same loader up front when the context loader itself is absent. This retains the existing resource and directory checks.Add three JUnit regressions for a null context classloader: finding an existing template, returning null for a missing template, and rejecting a directory. Each test restores the original context classloader in a finally block.
Validation on Windows / JDK 17:
mvn -DCI=true -pl compiler -am -Dtest=ClasspathResolverTest -Dsurefire.failIfNoSpecifiedTests=false test: 19 tests passed.023374b: the same seven failures remain, plus the three new classloader errors. The seven unchanged failures are newline-sensitive assertions in DynamicNamesTest, InterpreterTest, Issue278Test, MultipleRecursivePartialsTest and PreTranslateTest.mvn -DCI=true packageattempt stops at those compiler test failures, so the remaining reactor modules were not validated. The CI flag avoids the project's unrelated benchmark loops.git diff --checkpasses. No test resources are included in the patch.