Previously, when a project contained multiple `@ServletComponentScan`
annotated classes in classpath, and at least one annotation don't
explicitly specify `basePackages` and `basePackageClass` attribute,
the application could fail to start with an
UnsupportedOperationException. The failure occurred due to the
creating of an unmodifiable set when no base packages are configured
and a subsequent attempt to add base packages to that sit.
This commit fixes the issue by removing the use of an unmodifiable set
when `@ServletComponentScan` with no base packages in processed before
any other `@ServletComponentScan` annotations.
See gh-12715
Update `Restarter` to be much more defensive when attempting to clear
caches. We now use `clearCache()` methods whenever possible, and only
fall back to field access when absolutely necessary. In addition field
access now ignore any exceptions.
Fixes gh-12719
IntelliJ can shorten the classpath to a single classpath.jar in order to
circumvent errors originating from a too long classpath. This breaks the
filtering inside ModifiedClassPathRunner as the classpath contains only a
single jar to match against. This can be fixed by applying a similar
mechanism already provided for Surefire manifest-only booter JARs, which
extracts the real classpath from the JAR's Manifest file.
See gh-12535
Refine `BasicErrorController` mappings so that only JSON and XML get
structured responses. A simple string response is returned for all
other media types.
Fixes gh-12513
Update JAR `Handler` logic so that the existing `jarFile` is only used
if the requested URL starts with the same path. Prior to this commit it
was possible to construct a URL with another URL as context. This could
mean that the `handler` was shared and the already resolved `jarFile`
contained in the handler wasn't necessarily suitable.
Fixes gh-12483
Uses snapshots of the Dependency Management Plugin causes problems as
they are only published to our plugins-snapshot repository which may
not be configured in someone's build.
See gh-12406
This commit fixes a NPE when the static-locations array of
`ResourceProperties` has to be expanded as the setter is cleaning the
values of the array and is affected by a non-intuitive behaviour of the
binder.
When the binder needs to set an element of an array and the size of the
array isn't large enough, the binder proceeds as follows:
* An array of the required size is created
* The content of the original array is copied over
* The setter of the property is invoked with the new array
* The setter of the property is invoked and the returned array is
mutated to set the requested value
While one would expect the array to contain the requested value when the
setter is invoked, this is not the case. Also, the array might contain
null values if a value at index 8 should be set and the array has a size
of 3.
All in all, `ResourceProperties#appendSlashIfNecessary` has to account
for `null` and an additional round of cleaning has to happen once
binding has completed.
Closes gh-12360