Prior to this commit, the following exception was thrown when using the
PathMatchingResourcePatternResolver to scan for class path resources
using the `classpath*:` prefix within a native image.
com.oracle.svm.core.jdk.UnsupportedFeatureError: JRT file system is disabled
com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
jdk.internal.module.SystemModuleFinders$SystemImage.reader(SystemModuleFinders.java:139)
jdk.internal.module.SystemModuleFinders$ModuleContentSpliterator.<init>(SystemModuleFinders.java:527)
jdk.internal.module.SystemModuleFinders$SystemModuleReader.list(SystemModuleFinders.java:502)
org.springframework.core.io.support.PathMatchingResourcePatternResolver.lambda$findAllModulePathResources$6(PathMatchingResourcePatternResolver.java:819)
This commit addresses this by not attempting to scan the module path
when running in a GraalVM native image.
Closes gh-29183
In preparation for gh-29163, this commit revamps
PathMatchingResourcePatternResolverTests as follows.
- organizes tests into @Nested test classes
- reintroduces the @Disabled classpathStarWithPatternOnFileSystem() test
- stops asserting the protocol of Resource URLs, since the protocol is
dependent on the environment -- for example, file: and jar: URLs are
actually resource: URLs within a GraalVM native image
- simplifies implementation of test methods and assertFilenames()
Previously, only the first occurance of `@Reflective` and its
processor was considered. When `@Reflective` appeared twice on a type
due to meta-annotations or inheritance, this resulted in other
processors being ignored and hints were missing as a result.
This commit updates ReflectiveRuntimeHintsRegistrar to consider
every occurance of `@Reflective` found in the type hierarchy,
and to then use the processors from each of them.
Fixes gh-29193
This commit revisit BeanRegistrationCodeFragments to separate the
responsibility between the default implementation and the delegates. It
also reviews how customization are applied by improving the Javadoc and
the method name.
Closes gh-28865
gh-28506 introduces a big footprint regression on
native, so it should for now be skipped when
compiling to native images. Such support could
potentially be re-introduced via gh-29081.
Closes gh-29183
This commit improves `TestCompiler` with a `with` function that allows
to customize a test compiler instance. Rather than `TestCompiler`
knowing about `TestGenerationContext`, the latter implements the
function so that it can be passed as is.
See gh-29175
Update `TestCompiler` so that it can access and generate resources.
This change will allow the `TestCompiler` to be used with annotation
processor tests that generate resources.
Closes gh-29174
Co-authored-by: Phillip Webb <pwebb@vmware.com>
Update `TestCompiler` so that it can now load cglib generated classes.
This commit adds support to `DynamicJavaFileManager` so that it can
reference generated classes and adds a new lookup function to
`CompileWithTargetClassAccessClassLoader` to that it can load the
bytecode of generated classes directly.
See gh-29141
Co-authored-by: Phillip Webb <pwebb@vmware.com>
This commit removes the scoping of `RestTemplate` requests, since no
user code is meant to run during HTTP client exchanges.
This also polishes the reactive `WebFilter` to directly use the
specific enum when creating the observation.
Previously, the generated classes from an InMemoryGeneratedFiles were
not taken into account and if generated code refers to any of them,
compilation failed.
This commit introduces a ClasFile abstraction, similar to ResourceFile
for resources that represents an existing generated class.
Closes gh-29141
Co-authored-by: Andy Wilkinson <wilkinsona@vmware.com>