Commit Graph

24213 Commits

Author SHA1 Message Date
Sam Brannen
720261db26 Use List.of() and Set.of() where feasible 2022-05-30 18:42:48 +02:00
Sam Brannen
ad46f0295c Apply "instanceof pattern matching" 2022-05-30 18:41:25 +02:00
Sam Brannen
b629487b44 Polish Javadoc for MockFilterChain 2022-05-30 18:41:25 +02:00
Phillip Webb
6f71328ba6 Don't implicitly filter all AOT processor beans
Update `BeanDefinitionMethodGeneratorFactory` to not implicitly filter
AOT processor beans if they also implement
`BeanRegistrationExcludeFilter`.

Most AOT processor beans generate code that replaces themselves, so
implicitly filtering them is the right thing to do. However, some beans
may need to perform AOT processing and still get registered when the
AOT processed application runs. These beans can now additionally
implement `BeanRegistrationExcludeFilter` to signal that they should
not be implicitly filtered.

Closes gh-28526
2022-05-26 20:59:50 -07:00
Phillip Webb
efa8ffb728 Polish 2022-05-26 20:56:06 -07:00
Phillip Webb
718ef42d68 Exclude @Reflective from @AliasFor collection
Update `RuntimeHintsUtils` to skip `@Reflective` annotations when
checking for `@AliasFor`. Since the `@Reflective` annotation is only
used at AOT processing time, we shouldn't need a hint for it.

See gh-28528
2022-05-26 20:56:06 -07:00
Stephane Nicoll
86a85f558c Fix introspection of annotations that use local aliased attributes
Closes gh-28528
2022-05-26 15:50:41 +02:00
Sam Brannen
9e1d0057bc Merge branch '5.3.x' 2022-05-25 11:30:42 +02:00
Sam Brannen
a221835558 Throw IllegalStateException for invalid port in HierarchicalUriComponents
Prior to this commit, getPort() in HierarchicalUriComponents threw a
NumberFormatException for an invalid port supplied as a String, which
was inconsistent with exception handling elsewhere in the class as well
as within the same method.

This commit introduces a try-catch block in getPort() to consistently
throw IllegalStateExceptions for ports that cannot be parsed.

Closes gh-28521
2022-05-25 11:29:12 +02:00
Sam Brannen
aa06a09dee Polishing 2022-05-25 11:29:12 +02:00
Stephane Nicoll
059b66bf26 Register annotation based on its type
This commit improves registerAnnotation to use the annotation type
rather than a `MergedAnnotation` attribute.

See gh-28497
2022-05-25 10:30:43 +02:00
Sam Brannen
a60e9d6695 Merge branch '5.3.x' 2022-05-24 17:16:58 +02:00
hsteinmueller
bde0931e51 Fix Javadoc for DatabaseClient
The documentation for DatabaseClient had misplaced double quotes in the
example on how to map a select statement to a row.

Closes gh-28520
2022-05-24 17:15:44 +02:00
Sam Brannen
291f784196 Suppress warning in test 2022-05-24 17:12:16 +02:00
Sam Brannen
19b436c6aa Support module path scanning for "classpath*:" resource prefix
Prior to this commit, searching for classpath resources using the
"classpath*:" resource prefix did not find all applicable resources for
applications deployed as modules -- for example, when test classes and
resources are patched into the application module automatically by
Maven Surefire.

This affected component scanning -- for example, via [@]ComponentScan --
and PathMatchingResourcePatternResolver.getResources(String) in
general.

This commit addresses this by introducing first-class support for
scanning the module path when PathMatchingResourcePatternResolver's
getResources(String) method is invoked with a location pattern using
the "classpath*:" resource prefix. Specifically, getResources(String)
first searches all modules in the boot layer, excluding system modules.
It then searches the classpath using the existing Classloader-based
algorithm and returns the combined results.

Closes gh-28506
2022-05-24 12:09:36 +02:00
Stephane Nicoll
6bd25f60dd Polish 2022-05-24 11:57:14 +02:00
rstoyanchev
ff890bc1cc Support custom HTTP method for @HttpExchange
Closes gh-28504
2022-05-24 09:27:35 +01:00
rstoyanchev
48c1746693 Refactor HttpServiceProxyFactory for use as a bean
Closes gh-28505
2022-05-24 09:27:17 +01:00
Sam Brannen
29a9016809 Merge branch '5.3.x' 2022-05-23 20:36:47 +02:00
Sam Brannen
7b95c928d1 Fix Javadoc for ResourcePatternResolver 2022-05-23 20:32:01 +02:00
Sam Brannen
53f88d455f Fix Javadoc for AbstractFileResolvingResource.isFile(URI) 2022-05-23 20:32:01 +02:00
Sam Brannen
53a506f6bb Polishing 2022-05-23 20:22:37 +02:00
Sam Brannen
f07e7ab39d Create UrlResource factory methods that throw unchecked exceptions
UrlResource constructors throw checked exceptions which makes it
difficult to use them in java.util.Stream and java.util.Optional APIs
or other scenarios when a checked IOException is undesirable.

To support such use cases, this commit introduces `from(URI)` and
`from(String)` factory methods in UrlResource that throw
UncheckedIOExceptions.

Closes gh-28501
2022-05-23 14:22:52 +02:00
Sam Brannen
4515180195 Polish PathMatchingResourcePatternResolver 2022-05-23 14:22:43 +02:00
rstoyanchev
5e979af95a Merge branch '5.3.x' 2022-05-23 11:24:58 +01:00
rstoyanchev
2a2fba6a37 Resolve placeholders in HttpExchange#url
Closes gh-28492
2022-05-23 11:06:14 +01:00
rstoyanchev
ce568468ae Refine JSON encoding of non-streaming Flux
Closes gh-28398
2022-05-23 11:06:14 +01:00
rstoyanchev
496c1dcae1 Add RequestAttributeArgumentResolver
Closes gh-28458
2022-05-23 11:06:14 +01:00
rstoyanchev
495507e5d4 AbstractNamedValueArgumentResolver supports Object values
See gh-28458
2022-05-23 11:06:14 +01:00
rstoyanchev
f95bf96ec9 Correct path encoding/decoding in PathResourceResolver
Decoding is required for non-UrlResource when the HandlerMapping is
not expected to decode the path. Encoding is the opposite.

This commit ensures correct determination of whether the HandlerMapping
is expected to have decoded the path or not that in turn depends on
whether PathPattern or PathMatcher is in use.

Closes gh-27791
2022-05-23 11:03:42 +01:00
rstoyanchev
66a5742df3 Polishing 2022-05-23 10:07:03 +01:00
Stephane Nicoll
2f94713078 Make sure that annotation hierarchy is registered
This commit improves registerAnnotation to also registers the meta
annotation sources, if any. Without them, the annotation could not
be fully resolved.

See gh-28497
2022-05-23 08:57:02 +02:00
Sam Brannen
16a4a9ad3f Polishing 2022-05-21 14:30:46 +02:00
Sam Brannen
ea9b1fccbd Fix attribute return types in @PutExchange
The return types for the `value` and `url` attributes don't match those
in `@HttpExchange`.

See gh-28498
2022-05-21 14:28:47 +02:00
Eddú Meléndez
163bad38ef Fix attribute return types in @DeleteExchange and @PatchExchange
The return types for the `value` and `url` attributes don't match those
in `@HttpExchange`.

Closes gh-28498
2022-05-21 14:25:00 +02:00
Stephane Nicoll
d0afbe40e6 Tag EventListener as a reflective operation
This commit adds compatibility of declarative event listeners in a
native image.

See gh-28475
2022-05-20 15:14:59 +02:00
Stephane Nicoll
4cca190aad Add support of declarative use of reflection
This commit adds a `@Reflective` annotation that can be used to declare
that the annotated element requires reflection at runtime. By default,
the annotated element is exposed but this can be customized by
specifying a dedicated `ReflectiveProcessor`.

Closes gh-28469
2022-05-20 15:02:46 +02:00
Stephane Nicoll
2517c72f7d Add a common utility to register hints for an annotation
This commit adds a utility that takes care of registering the necessary
hints to make an annotation visible at runtime. The core framework may
create a JDK proxy if necessary, which requires specific handling.

Closes gh-28497
2022-05-20 14:54:27 +02:00
wonwoo
9181ac70f5 Correctly detect Optional return type for @HttpExchange methods
Prior to this commit, a ClassCastException was thrown for an Optional
return type for an @HttpExchange method. This is because the check for
an Optional return type was based on the type contained in the Optional
instead of the Optional itself.

Closes gh-28493
2022-05-20 11:25:31 +02:00
Stephane Nicoll
9487e8ce1e Polish 2022-05-18 13:57:48 +02:00
Sam Brannen
65066bd1e1 Fix Java 17 compiler warning about varargs 2022-05-17 15:44:55 +02:00
Sam Brannen
70415b1781 Merge branch '5.3.x' 2022-05-17 15:41:08 +02:00
Sam Brannen
59c7bb1f86 Use Arrays.toString instead of Arrays.asList when generating Strings 2022-05-17 15:36:31 +02:00
Sam Brannen
a1c3efbb5f Polish ManagedList[Tests] and ManagedSet[Tests] 2022-05-17 15:36:31 +02:00
Sam Brannen
874077d16e Apply "advanced" instanceof pattern matching 2022-05-17 11:24:32 +02:00
Sam Brannen
578d3f4466 Polish error message 2022-05-17 11:22:56 +02:00
Sam Brannen
0d4d383068 Merge branch '5.3.x' 2022-05-16 11:22:17 +02:00
Sam Brannen
6efe3aee34 Polishing 2022-05-16 11:20:20 +02:00
Sam Brannen
fe7c6f075b Polishing 2022-05-16 10:53:35 +02:00
Sam Brannen
bf8a54decf Switch focus to JUnit Jupiter in testing examples 2022-05-16 10:05:37 +02:00