Commit Graph

2907 Commits

Author SHA1 Message Date
Sam Brannen 353666627f Polishing 2022-07-13 12:18:29 +02:00
Juergen Hoeller dfae4eec2d Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/cglib/core/ReflectUtils.java
#	spring-core/src/main/java/org/springframework/core/ResolvableType.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
#	spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java
2022-07-13 11:16:13 +02:00
Juergen Hoeller a3e46a2db7 ResolvableType.forInstance returns NONE for null instance
Closes gh-28776
2022-07-13 11:10:35 +02:00
Juergen Hoeller de1b938e2e Improve diagnostics for CGLIB ClassLoader mismatch with --add-opens hint
Closes gh-28747
2022-07-13 11:10:00 +02:00
Juergen Hoeller d72aeac319 Create well-known non-interface types without using reflection
Closes gh-28718
2022-07-13 11:09:43 +02:00
Stephane Nicoll 2c92d7da8f Harmonize RuntimeHintsRegistrar implementations
Closes gh-28801
2022-07-12 18:30:23 +02:00
Stephane Nicoll 44d7e2775f Polish 2022-07-12 16:16:12 +02:00
Stephane Nicoll 54a3f66d1d Move RuntimeHints predicate support to a dedicated package
This commit moves `RuntimeHintsPredicate` and its support classes that
form a cohesive concept in a dedicated `.predicate` package.

Closes gh-28799
2022-07-12 16:16:12 +02:00
Stephane Nicoll 40c8b7c59f Stop using package protected code
See gh-28799
2022-07-12 16:16:12 +02:00
Sam Brannen 5c2870ebd9 Test support for serializable records in SerializationUtils
See gh-28798
2022-07-12 15:35:13 +02:00
Stephane Nicoll ee6a4e7c1e Add predicates for Serialization hints
Closes gh-28772
2022-07-11 16:37:12 -04:00
Sam Brannen 255a52bc7a Fix attribute aliasing in @Reflective
See gh-28469
2022-07-11 19:14:39 +02:00
Sam Brannen c991aa9a78 Add missing package-info 2022-07-11 18:18:29 +02:00
Sam Brannen c86d193a78 Polish AotDetector 2022-07-11 18:18:08 +02:00
Sam Brannen 656dc549b1 Reject JDK proxy hint registration for sealed interfaces
Closes gh-28786
2022-07-11 17:48:40 +02:00
Sam Brannen 5c2ee249b5 Polish ProxyHintsTests 2022-07-11 17:48:39 +02:00
Sam Brannen d8003e326d Revert "Introduce ProxyHints.registerJdkProxy(String...)"
This reverses commit b560c10d4c.

See gh-28781
2022-07-11 17:48:39 +02:00
Sam Brannen 5178e9c28e Simplify hint registration for Spring AOP proxies
Prior to this commit, when users wished to register proxy hints for a
Spring AOP JDK dynamic proxy, they were required to explicitly specify
SpringProxy, Advised, and DecoratingProxy along with user interfaces.

This commit simplifies hint registration for Spring AOP proxies by
introducing two completeJdkProxyInterfaces() methods in AopProxyUtils,
one that accepts strings and one that accepts classes that represent
the user-specified interfaces implemented the user component to be
proxied. The SpringProxy, Advised, and DecoratingProxy interfaces are
appended to the user-specified interfaces and returned as the complete
set of interfaces that the proxy will implement.

Closes gh-28745
2022-07-10 20:10:12 +02:00
Sam Brannen b560c10d4c Introduce ProxyHints.registerJdkProxy(String...)
Since users might not have a concrete need to work with TypeReference,
this commit introduces ProxyHints.registerJdkProxy(String...) to
simplify use of the API for registering a dynamic proxy based on fully
qualified class names of the required interfaces.

Closes gh-28781
2022-07-10 18:54:16 +02:00
Sam Brannen 9db43037fe Polishing 2022-07-10 18:31:58 +02:00
Sam Brannen d7b45b7c8e Improve diagnostics for convention-based annotation attribute overrides
The warning message logged for an annotation that still uses
convention-based overrides now includes a concrete suggestion for how
the problem may potentially be fixed.

  WARN - Support for convention-based annotation attribute overrides is
  deprecated and will be removed in Spring Framework 6.1. Please
  annotate the 'locations' attribute in
  @org.springframework.core.annotation.MergedAnnotationsTests$ConventionBasedComposedContextConfiguration
  with an appropriate @AliasFor declaration -- for example,
  @AliasFor(annotation = org.springframework.core.annotation.MergedAnnotationsTests$ContextConfiguration.class).

See gh-28760
2022-07-09 17:15:17 +02:00
Sam Brannen 597873746c Update test annotations due to removal of AnnotationAttributesReadingVisitor
Annotations are no longer required to be public when looked up via
ASM since 6.0 M1.
2022-07-09 16:50:24 +02:00
Sam Brannen 2af08cf163 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java
#	spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java
#	spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java
#	spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java
2022-07-09 16:24:04 +02:00
Sam Brannen d274e893a6 Remove superfluous static declaration for enum, annotation, & interface 2022-07-09 16:16:13 +02:00
Sam Brannen 73d92d66b9 Stop using convention-based annotation attribute overrides in tests
This commit replaces convention-based annotation attribute overrides in
tests with explicit use of @AliasFor -- except for tests in spring-core,
since we still want to test our support for convention-based annotation
attribute overrides.

See gh-28760
2022-07-08 19:28:14 +02:00
Sam Brannen 6812de7b82 Polishing 2022-07-08 19:24:15 +02:00
Sam Brannen 9f7cbe1234 Polishing 2022-07-07 17:50:45 +02:00
Sam Brannen a68f5b1674 Deprecate convention-based annotation attribute overrides
Implicit convention-based annotation attribute overrides have been
supported for a long time; however, Spring Framework 4.2 introduced
support for explicit annotation attribute overrides via @AliasFor.

Since explicit overrides are favorable to implicit overrides, and since
the support for convention-based overrides increases the complexity of
Spring's annotation search algorithms, this commit deprecates
convention-based overrides and logs a WARNING whey the are encountered.

For example, the following message is logged for a test that still
uses convention-based overrides. A log message is generated for each
such attribute in a given annotation but only once per application run.

  WARN Support for convention-based annotation attribute overrides is
  deprecated and will be removed in Spring Framework 6.1. Please
  annotate the 'basePackages' attribute in
  @org.springframework.context.annotation.ConfigurationClassPostProcessorTests$ComposedConfigurationWithAttributeOverrides
  with an appropriate @AliasFor declaration.

Closes gh-28760
2022-07-07 17:36:16 +02:00
Sam Brannen 81acbe7e2f Ensure AnnotationTypeMapping properly tracks convention-based mappings
AnnotationTypeMapping.addConventionMappings() sometimes adds
convention-based mappings that it should not.

For example, in certain circumstances an explicit annotation attribute
override configured via @AliasFor can be incorrectly mapped as
convention-based.

Although this does not appear to cause negative side effects (other
than unnecessary processing), this is technically a bug, and this
commit address this issue.

Closes gh-28773
2022-07-07 17:33:27 +02:00
Sébastien Deleuze 5397d4721b Recognize PRESENT fields in native classpath checks at build time
This pattern is used in Spring Boot.

See gh-28624
2022-07-07 11:48:43 +02:00
Sébastien Deleuze cdf01ede8d Perform Reactor native classpath checks at build time
See gh-28624
2022-07-06 16:39:00 +02:00
Sam Brannen a122a0e8c8 Simplify RuntimeHintsUtilsTests 2022-07-06 15:24:16 +02:00
Sam Brannen c54b1519e4 Merge branch '5.3.x' 2022-07-06 13:20:16 +02:00
Sam Brannen 323dbb912e Move convention-based attribute override tests to @Nested class 2022-07-06 13:19:41 +02:00
Sam Brannen a194fa0e87 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/MergedAnnotationsTests.java
2022-07-06 11:51:09 +02:00
Sam Brannen 07960d4918 Polishing 2022-07-06 11:44:15 +02:00
Sam Brannen 07cfcbc3a9 Move convention-based attribute override tests to @Nested class 2022-07-06 11:42:39 +02:00
Sam Brannen d533eb4a55 Use Set.of() in StringToBooleanConverter 2022-07-05 14:10:33 +02:00
Sam Brannen 613aac5009 Merge branch '5.3.x' 2022-07-05 13:57:54 +02:00
Sam Brannen 2af27d899f Trim string input in Converters where whitespace is irrelevant
Closes gh-28756
2022-07-05 13:53:00 +02:00
Sam Brannen 338609a168 Merge branch '5.3.x' 2022-07-04 19:31:47 +02:00
Sam Brannen 2bf5f7a6b3 Introduce lenient parsing in DataSize regarding whitespace
Prior to this commit, a DataSize input string could not be parsed if it
contained any whitespace.

With this commit, a DataSize input string can contain leading, trailing,
or 'in between' whitespace. For example, the following will be parsed
to the same DataSize value.

- "1024B"
- "1024 B"
- " 1024B "
- " 1024 B "

Closes gh-28643
2022-07-04 19:24:58 +02:00
Sam Brannen bf39492c34 Introduce StringUtils.trimAllWhitespace(CharSequence)
Closes gh-28757
2022-07-04 19:24:45 +02:00
Sébastien Deleuze b64edebadc Improve ConstantFieldFeature compatibility
This commit makes ConstantFieldFeature
compatible with GraalVM 22.2 while retaining
GraalVM 22.1 compatibility.

See gh-28624
2022-07-04 11:59:01 +02:00
Sam Brannen ce5076ffe8 Merge branch '5.3.x' 2022-07-03 18:05:36 +02:00
Sam Brannen f732fab820 Delete unused imports and dead code in CGLIB fork 2022-07-03 17:30:30 +02:00
Brian Clozel 7a3e8bf648 Fix NPE in Constructor predicate
This commit fixes a NullPointerException issue in the constructor hint
predicate. Prior to this commit, a hint for a constructor was directly
looked up and dereferenced a type hint without checking if there was one
first.
2022-06-30 18:20:38 +02:00
Sébastien Deleuze 9135921d1d Move BindingReflectionHintsRegistrar to spring-context
Closes gh-28735
2022-06-30 11:56:08 +02:00
Sébastien Deleuze c5cf7c0ab0 Polishing
See gh-28635
2022-06-30 11:44:44 +02:00
Sébastien Deleuze da68781b9e Add support for records in BindingReflectionHintsRegistrar
Closes gh-28721
2022-06-30 11:43:16 +02:00