Commit Graph

25945 Commits

Author SHA1 Message Date
Brian Clozel 9465110917 Polish
See gh-26707
2022-09-26 22:25:44 +02:00
chenrl b71e686cbd Fix ServletContextResource isFile check
Prior to this commit, `ServletContextResource` could rely on
`ServletContext#getRealPath` to check whether a resource exists.
This behavior is not enforced on some Servlet containers, as this method
is only meant to translate virtual paths to real paths, but not
necessarily check for the existence of the file.

See https://bz.apache.org/bugzilla/show_bug.cgi?id=55837#c3 for a
rationale of this behavior in Tomcat.

This commit enforces an additional check, resolving the path as a `File`
and checking that is exists and is a file.

Closes gh-26707
2022-09-26 22:20:15 +02:00
Brian Clozel 9c400ed384 Polish Stream#toList() consistent usage
In general, `Stream#toList()` is not a transparent replacement for
`.collect(Collectors.toList()))`, as the former returns an immutable
list.

This commit reverts some of those changes, where the returned `List`
instance was expected to be mutable.

See gh-29203
2022-09-26 20:25:13 +02:00
Adam Ostrožlík 641303baff Remove unnecessary sync block in ControllerMethodResolver
Closes gh-29208
2022-09-26 18:32:01 +02:00
Adam Ostrožlík 0ccb64fe10 Replace Collectors.toList with Stream.toList
Closes gh-29203
2022-09-26 18:32:01 +02:00
ijonathanc 9d263668d5 Pass current request to filter in RouterFunction extensions
This commit ensures that the proper request is passed in the
Kotlin RouterFunction extension DSL.

Closes gh-27086
2022-09-26 14:55:14 +02:00
Sam Brannen a975b9d5da Suppress "unused" warnings in tests 2022-09-26 14:27:32 +02:00
Sam Brannen 2872282d75 Ensure Kotlin JMH folder is imported as test folder in Eclipse
Commit 9a180d1811 introduced Kotlin-based
JMH benchmarks which prevent spring-beans from being imported into the
Eclipse IDE.

This commit ensures that src/jmh/kotlin is imported in Eclipse with the
"test" attribute set.

See gh-24104
2022-09-26 14:21:49 +02:00
Сергей Цыпанов 8a87e118e1 Remove redundant assignment of default values to volatile/atomic fields
Closes gh-27477
2022-09-26 13:43:04 +02:00
Brian Clozel e8d24ae693 Fix HTTP interface section title in ref docs 2022-09-26 13:39:51 +02:00
Stephane Nicoll 2c0a9e0e30 Merge pull request #23418 from Syquel
* pr/23418:
  Polish "Improve resolution of generic type variables"
  Improve resolution of generic type variables

Closes gh-23418
2022-09-26 13:13:24 +02:00
Stephane Nicoll b11e885e00 Polish "Improve resolution of generic type variables"
See gh-23418
2022-09-26 13:07:43 +02:00
Frederik Boster 124a76b1ad Improve resolution of generic type variables
See gh-23418
2022-09-26 13:04:26 +02:00
Stephane Nicoll 267908a118 Polish 2022-09-26 11:15:43 +02:00
Sébastien Deleuze 9a180d1811 Add JMH benchmarks
Closes gh-24104
2022-09-26 10:23:06 +02:00
Sébastien Deleuze 8e73b57329 Refine Kotlin changes
This refinement ensures the constructor is properly
accessible, avoid duplicating current logic and
provide a slightly faster implementation of the
Kotlin codepath.

See gh-24104
2022-09-26 10:22:46 +02:00
stsypanov edcc559b4a Add fast-path in BeanUtils#instantiateClass
For no-args constructor.

See gh-24104
2022-09-26 10:21:28 +02:00
Sébastien Deleuze 42ab1b75e7 Fix a regression in Kotlin serialization support
After gh-29068, some Type instances can throw an
IllegalArgumentException. This commit catches them
properly to just return a null serializer in that
case.

Closes gh-29192
2022-09-26 09:55:44 +02:00
Lars Grefer 94e5eb3eb6 Consider empty jar entries as readable
Prior to this commit, resource handling would not serve empty files and
return instead HTTP 404 responses. This would only happen for files
contained by JARs, but not on the filesystem.

This can be tracked to changes done in `AbstractFileResolvingResource`
where we avoid serving empty files for directories, see gh-21372.
This commit improves the `checkReadable` method to align this behavior
between file system and JAR files.

Closes gh-28850
2022-09-26 09:51:11 +02:00
Stephane Nicoll dfd1a31435 Merge branch '5.3.x' 2022-09-26 09:07:27 +02:00
Stephane Nicoll 433a23a0bd Merge pull request #29190 from dreis2211
* pr/29190:
  Polish "Avoid resizing of Maps created by CollectionUtils"
  Avoid resizing of Maps created by CollectionUtils

Closes gh-29190
2022-09-26 09:06:52 +02:00
Stephane Nicoll 7309fe9f2e Polish "Avoid resizing of Maps created by CollectionUtils"
See gh-29190
2022-09-26 09:00:45 +02:00
Christoph Dreis 874a296a76 Avoid resizing of Maps created by CollectionUtils
See gh-29190
2022-09-26 08:54:52 +02:00
Stephane Nicoll 82ae2a0326 Merge branch '5.3.x' 2022-09-26 08:53:14 +02:00
Stephane Nicoll d872e7c326 Merge pull request #29198 from izeye
* pr/29198:
  Use actions/checkout@v3 for Gradle Wrapper Validation Action

Closes gh-29198
2022-09-26 08:52:30 +02:00
Johnny Lim 4ca574cde1 Use actions/checkout@v3 for Gradle Wrapper Validation Action
See gh-29198
2022-09-26 08:52:21 +02:00
Stephane Nicoll 5275be3adf Merge branch '5.3.x' 2022-09-26 08:50:58 +02:00
Stephane Nicoll 98ecf0a412 Merge pull request #29201 from inabajunmr
* pr/29201:
  Fix MockMvc sample setup

Closes gh-29201
2022-09-26 08:50:49 +02:00
inaba jun ddef70935a Fix MockMvc sample setup
See gh-29201
2022-09-26 08:50:01 +02:00
Stephane Nicoll 86578e10f1 Merge pull request #29202 from izeye
* pr/29202:
  Polish "Deprecate support for theme" changes

Closes gh-29202
2022-09-26 08:47:09 +02:00
Johnny Lim 907c96b21e Polish "Deprecate support for theme" changes
See gh-29202
2022-09-26 08:46:19 +02:00
Sam Brannen f31eb2dcf9 Skip scanning the module path when running in a native image
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
2022-09-25 19:31:06 +02:00
Sam Brannen 6affae4120 Polish resourceArrayPropertyEditor() test 2022-09-25 19:31:06 +02:00
Sam Brannen 29442d4b7a Revamp PathMatchingResourcePatternResolverTests
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()
2022-09-25 16:12:46 +02:00
rstoyanchev 57067f58e1 Polishing contribution
Closes gh-28401
2022-09-23 16:54:15 +01:00
rstoyanchev c2f1ddcee9 Consistent Nullable input in Hints 2022-09-23 16:54:15 +01:00
Laber, Jason M 27b5d141e2 Allow customization for ObjectReader and ObjectWriter
Allows customization from subclasses of
AbstractJackson2HttpMessageConverter, AbstractJackson2Decoder, and
AbstractJackson2Encoder

See gh-28401
2022-09-23 16:54:15 +01:00
rstoyanchev 74df50c906 Polishing ProblemDetail Javadoc 2022-09-23 16:54:02 +01:00
Andy Wilkinson a409e0fd2c Consider all processors when processing `@Reflective`
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
2022-09-23 16:31:35 +02:00
Stephane Nicoll c19cedede1 Revisit BeanRegistrationCodeFragments
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
2022-09-22 15:32:28 +02:00
Arjen Poutsma ef5b64dc00 Minor Javadoc correction 2022-09-22 12:26:16 +02:00
Stephane Nicoll 84fd942712 Add support for Charset for property value code generation
Closes gh-29186
2022-09-21 19:27:05 +02:00
rstoyanchev 5192d99fa4 Support formatting annotations on HTTP service interface
Closes gh-29095
2022-09-21 16:18:39 +01:00
Sébastien Deleuze 157c28bcec Enable HTTP and HTTPS on native in spring-web module
Closes gh-29185
2022-09-21 16:47:57 +02:00
Sébastien Deleuze 23a58e6bab Skip ModuleFinder#ofSystem usage on native
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
2022-09-21 16:47:57 +02:00
Sam Brannen 39208eaccd Upgrade to JUnit 5.9.1
Closes gh-29179
2022-09-20 22:04:15 +02:00
Phillip Webb 6802665177 Refactor GeneratedFilesTestCompilerUtils to CompilerFiles
See gh-29175
2022-09-20 11:00:56 -07:00
Sébastien Deleuze 77fdd69cd1 Skip Javadoc generation for the GraalVM feature module
It is currently broken due to missing modules/exports
configuration and it is not a public API we want to document.

Closes gh-29178
2022-09-20 16:38:48 +02:00
Stephane Nicoll 4625e92eb8 Break dependency between TestCompiler and AOT
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
2022-09-20 15:07:51 +02:00
Stephane Nicoll 2f84096af1 Polish 2022-09-20 15:07:50 +02:00