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

Prefer modified resources over the originals in TestCompiler #33850

Conversation

wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented Nov 6, 2024

Previously, when the test compiler had been seeded with a resource file, any modifications to this resource performed during compilation would be lost as the original content would always be returned.

This PR updates the DynamicJavaFileManager to always store the dynamic resource in the dynamicResourceFiles map, irrespective of whether it's being created afresh or from some existing resource content. This ensures that any modifications made to the resource can be retrieved later on.

Similarly, DynamicClassLoader has been updated to prefer dynamic resource files over any original resource files. This ensures that the resource that it finds reflects any modifications that have been made to it.

Previously, when the test compiler had been seeded with a resource
file, any modifications to this resource performed during
compilation would be lost as this original content would always
be returned.

This commit updates the DynamicJavaFileManager to always store
the dynamic resource in the dynamicResourceFiles map, irrespective
of whether it's being created afresh or from some existing resource
content. This ensures that any modifications made to the resource
can be retrieved later on.

Similarly, DynamicClassLoader has been updated to prefer dynamic
resource files over any original resource files. This ensures that
the resource that it finds reflects any modifications that have
been made to it.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 6, 2024
@sbrannen sbrannen added in: test Issues in the test module theme: aot An issue related to Ahead-of-time processing labels Nov 6, 2024
@sbrannen sbrannen changed the title Prefer modified resources over the originals in TestCompiler Prefer modified resources over the originals in TestCompiler Nov 6, 2024
@snicoll snicoll added type: enhancement A general enhancement and removed theme: aot An issue related to Ahead-of-time processing status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 6, 2024
@snicoll snicoll added this to the 6.1.15 milestone Nov 6, 2024
@snicoll snicoll self-assigned this Nov 6, 2024
@snicoll snicoll changed the title Prefer modified resources over the originals in TestCompiler Prefer modified resources over the originals in TestCompiler Nov 6, 2024
snicoll pushed a commit that referenced this pull request Nov 6, 2024
Previously, when the test compiler had been seeded with a resource
file, any modifications to this resource performed during
compilation would be lost as this original content would always
be returned.

This commit updates the DynamicJavaFileManager to always store
the dynamic resource in the dynamicResourceFiles map, irrespective
of whether it's being created afresh or from some existing resource
content. This ensures that any modifications made to the resource
can be retrieved later on.

Similarly, DynamicClassLoader has been updated to prefer dynamic
resource files over any original resource files. This ensures that
the resource that it finds reflects any modifications that have
been made to it.

See gh-33850
@snicoll snicoll closed this in 541866f Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants