Commit Graph

3242 Commits

Author SHA1 Message Date
Sam Brannen b5b80d0a07 Polishing 2022-12-16 14:50:02 +01:00
Carlos Belizón 5d2ca11315
Fix manipulating property sources example in Javadoc for ConfigurableEnvironment
The "manipulating property sources" example in the Javadoc for
`ConfigurableEnvironment` states that `MutablePropertySources`
expect a `Map<String,String>`; whereas it expects a
`Map<String,Object>`.

Closes gh-29693
2022-12-16 13:47:40 +01:00
Sam Brannen 6e08c56076 Improve Javadoc for RepeatableContainers 2022-12-14 13:40:43 +01:00
Sam Brannen fb6d3f5b5c Remove duplicated test code 2022-12-14 13:26:51 +01:00
Sam Brannen e7bcb48e57 Remove obsolete AttributeMethods.hasOnlyValueAttribute() method
See gh-29685
2022-12-13 16:01:05 +01:00
Sam Brannen 433b1c480c Support repeatable annotation containers with multiple attributes
Prior to this commit, there was a bug in the implementation of
StandardRepeatableContainers.computeRepeatedAnnotationsMethod() which
has existed since Spring Framework 5.2 (when
StandardRepeatableContainers was introduced). Specifically,
StandardRepeatableContainers ignored any repeatable container
annotation if it declared attributes other than `value()`. However,
Java permits any number of attributes in a repeatable container
annotation.

In addition, the changes made in conjunction with gh-20279 made the bug
in StandardRepeatableContainers apparent when using the
getMergedRepeatableAnnotations() or findMergedRepeatableAnnotations()
method in AnnotatedElementUtils, resulting in regressions for the
behavior of those two methods.

This commit fixes the regressions and bug by altering the logic in
StandardRepeatableContainers.computeRepeatedAnnotationsMethod() so that
it explicitly looks for the `value()` method and ignores any other
methods declared in a repeatable container annotation candidate.

Closes gh-29685
2022-12-13 16:00:55 +01:00
Sam Brannen 0b08246760 Revise RepeatableContainersTests 2022-12-13 15:54:43 +01:00
Sébastien Deleuze b27735d4a6 Refine BindingReflectionHintsRegistrar Kotlin support
Closes gh-29593
2022-12-11 12:02:55 +01:00
Sébastien Deleuze dc5a773b2b Support properties on records in BindingReflectionHintsRegistrar
Closes gh-29571
2022-12-10 16:12:23 +01:00
Sam Brannen b0b2bbc857 Polish CGLIB fork
- primarily automated "clean up" using Eclipse IDE
2022-12-09 00:56:38 -05:00
Sam Brannen 69f47e7700 Polishing
- primarily automated "clean up" using Eclipse IDE
2022-12-09 00:56:00 -05:00
Sam Brannen 098c924e32 Introduce @Suite classes for individual modules 2022-12-07 12:12:41 -05:00
Brian Clozel d601f3196a Fix BindingReflectionHintsRegistrar anonymous classes support
This commit ensures that giving an anonymous class for reflection hints
registration does not result in a NullPointerException, since the
canonical name of anonymous classes is null.

Fixes gh-29657
2022-12-07 16:37:01 +01:00
Arjen Poutsma 92a6e7ddcd Fix InputStream violation in DataBufferInputStream
This commit fixes an issue in DataBufferInputStream::mark, which before
did not follow the contract defined by InputStream.

Closes gh-29642
2022-12-07 15:23:19 +01:00
Brian Clozel 4a555aaef1 Reduce heap memory usage in ConcurrentLruCache
Prior to this commit, the `ConcurrentLruCache` implementation would use
arrays of `AtomicReference` as operation buffers, and the buffer count
would be calculated with the nearest power of two for the CPU count.

This can result in significant heap memory usage as each
`AtomicReference` buffer entry adds to the memory pressure. As seen in
FasterXML/jackson-databind#3665, this can add a significant overhead for
no real added benefit for the current use case.

This commit changes the current implementation to use
`AtomicReferenceArray` as buffers and reduce the number of buffers.
JMH benchmarks results are within the error margin so we can assume that
this does not change the performance characteristics for the typical use
case in Spring Framework.

Fixes gh-29520
2022-12-05 13:02:11 +01:00
Sam Brannen ad60164911 Update copyright headers for source code changed since August 2022
The changes in this commit were performed using the newly introduced
update_copyright_headers.sh script.
2022-11-29 19:38:42 +01:00
Sam Brannen fdec9f0adc Apply "instanceof pattern matching" 2022-11-29 18:09:42 +01:00
Sam Brannen a88dbbec98 Apply project formatting rules for ternary operator
Discovered via RegEx: ^\s+\?
2022-11-29 17:51:13 +01:00
Juergen Hoeller 8e5eb84da1 Consistently register CGLIB hints for lazy resolution proxy classes
Core JDK/CGLIB proxy registration code extracted to ClassHintUtils.

Closes gh-29584
2022-11-26 13:38:34 +01:00
Juergen Hoeller b7e99fbe30 Additional documentation notes on Java/Kotlin parameter name retention
See gh-29563
2022-11-24 14:08:53 +01:00
Juergen Hoeller cbf25b704d Reduce deprecation warn logging to one entry per introspected class
Closes gh-29563
2022-11-24 12:01:03 +01:00
Juergen Hoeller fe5bd6751f Retain default LocalVariableTableParameterNameDiscoverer with warn log entries
For a transition period, LocalVariableTableParameterNameDiscoverer logs a warning for each successful resolution attempt now, suggesting that -parameters was missed.

See gh-29531
See gh-29559
2022-11-23 10:31:43 +01:00
Juergen Hoeller beb9fa2b8b Add since attribute to Deprecated annotation
Also retaining standard Java parameter names for Spring's AspectJ sources now.

See gh-29531
2022-11-22 21:18:34 +01:00
Juergen Hoeller 459e8a1ea5 Deprecate LocalVariableTableParameterNameDiscoverer completely
LocalVariableTableParameterNameDiscoverer is not registered by default anymore now.
Java sources should be compiled with `-parameters` instead (available since Java 8).
Also retaining standard Java parameter names for all of Spring's Kotlin sources now.

Closes gh-29531
2022-11-22 19:26:15 +01:00
Sam Brannen 7fcd1de8e3 Use AssertJ's isEmpty() instead of hasSize(0)
Achieved via global search-and-replace.
2022-11-22 17:11:50 +01:00
Sam Brannen d5b0b2b1a1 User AssertJ's hasSize() for arrays
Achieved via global search-and-replace.
2022-11-22 17:03:45 +01:00
Sam Brannen 36f7597f25 Use AssertJ's hasSize() for collections and maps
Achieved via a global search-and-replace.
2022-11-22 16:50:10 +01:00
Juergen Hoeller 7816c9e411 Exclude LocalVariableTableParameterNameDiscoverer based on native image check
See gh-29531
2022-11-22 15:37:00 +01:00
Sam Brannen 917c41fd52 Use Set.of() for constant sets where appropriate 2022-11-21 16:49:07 +01:00
Sébastien Deleuze 64c6a97130 Make GeneratorStrategy.generate unreachable on native
This change provides also more information to the user
about the missing generated class when that happens.

Closes gh-29521
2022-11-21 13:04:20 +01:00
Sébastien Deleuze f4e23fe204 Do not use LocalVariableTableParameterNameDiscoverer in AOT mode
Closes gh-29531
2022-11-21 11:50:08 +01:00
Sébastien Deleuze 04366f4129 Update LogAdapter to allow build-time code removal
Allow for example to remove those classes and 90 related methods when Logback is used:
- org.apache.commons.logging.LogAdapter$JavaUtilAdapter
- org.apache.commons.logging.LogAdapter$JavaUtilLog
- org.apache.commons.logging.LogAdapter$LocationResolvingLogRecord
- org.apache.commons.logging.LogAdapter$Log4jAdapter
- org.apache.commons.logging.LogAdapter$Log4jLog
- org.apache.commons.logging.LogAdapter$LogApi
- org.apache.logging.log4j.message.ObjectMessage
- org.apache.logging.log4j.message.ReusableObjectMessage
- org.apache.logging.log4j.simple.SimpleLoggerContext
- org.apache.logging.log4j.simple.SimpleLoggerContextFactory

Closes gh-29506
2022-11-21 11:49:48 +01:00
Sébastien Deleuze b52300eab8 Document GraalVM substitutions upcoming removal 2022-11-17 18:01:02 +01:00
Sam Brannen 508d2c7a77 Fix Javadoc formatting issues for headings
Headings in method-level Javadoc must be h4 or higher in recent versions
of Java.
2022-11-16 14:09:42 +01:00
Arjen Poutsma 9be6cea012 Polishing deprecated methods
Added since and forRemoval to Deprecated methods.
2022-11-16 09:58:04 +01:00
Andy Wilkinson 37b439182e Align javadoc of DefaultParameterNameDiscoverer with its behavior 2022-11-16 08:16:57 +01:00
Juergen Hoeller f8b4be3b82 Straight filename extraction for URI path (decoded and standard separators)
See gh-29486
2022-11-15 12:50:15 +01:00
Sam Brannen abf3400c07 Use Assert.state() where appropriate 2022-11-15 12:31:10 +01:00
Sam Brannen 2aa78889d2 Use consistent wording in precondition error messages 2022-11-15 12:31:01 +01:00
Juergen Hoeller 9235e3996f Equivalent code without java.net.URL constructor in comment blocks
See gh-29486
See gh-29481
2022-11-15 00:33:48 +01:00
Juergen Hoeller 7d2543ed82 Extract filename from cleaned path (for consistent separator handling)
See gh-29486
2022-11-14 23:53:39 +01:00
Juergen Hoeller aaeb5eb0d2 Avoid direct URL construction and URL equality checks
Closes gh-29486
2022-11-14 23:23:12 +01:00
Sam Brannen eb91d21ada Polishing 2022-11-13 18:21:56 +01:00
Sam Brannen 1f0a35bacc Remove outdated documentation in @Reflective 2022-11-13 16:57:54 +01:00
Sam Brannen 1b61217705 Polishing 2022-11-12 14:40:55 +01:00
Juergen Hoeller ffd45c0e7b Move reflection hints for ObjectToObjectConverter conventions to aot.hint.support
Avoids an accidental package cycle between aot and core (only aot->core allowed).

See gh-29429
2022-11-12 11:23:40 +01:00
Sam Brannen f26a7dee97 Fix broken tests, update copyright dates, and polish
See gh-29414
2022-11-08 20:07:53 +01:00
Kulwant Singh b2c8546013 Rely on automatic boxing/unboxing in tests
Closes gh-29414
2022-11-08 19:38:03 +01:00
Sébastien Deleuze ce9e2e4d89 Register reflection hints for date ObjectToObjectConverter conventions
Closes gh-29429
2022-11-08 17:39:37 +01:00
Sam Brannen af170f693a Deprecate obsolete Assert APIs for removal in 6.1
See gh-29449
2022-11-08 16:55:06 +01:00