Commit Graph

3228 Commits

Author SHA1 Message Date
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
Sam Brannen
727aa517d8 Merge branch '5.3.x' 2022-11-08 16:34:40 +01:00
Sam Brannen
f4b3333fa8 Avoid reflection for annotation attribute method invocations
As a follow up to 332b25b680, this commit consistently avoids the use of
reflection for annotation attribute method invocations.

See gh-29301
Closes gh-29448
2022-11-08 16:23:33 +01:00
Sébastien Deleuze
60c9f2f72f Add support for Jackson annotations in BindingReflectionHintsRegistrar
This commits registers reflection hints on field and methods
where Jackson annotations are detected.

Closes gh-29426
2022-11-08 16:19:27 +01:00
Juergen Hoeller
86d45578d9 Introduce findAllAnnotationsOnBean variant on ListableBeanFactory
Closes gh-29446
2022-11-08 13:29:33 +01:00
Sam Brannen
3438c47744 Polishing 2022-11-08 11:48:13 +01:00
Sam Brannen
ac5eb9bfd3 Avoid String allocations with Assert.isTrue() 2022-11-05 14:51:36 +01:00
Sam Brannen
82823517fa Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequesterBuilder.java
#	spring-messaging/src/main/java/org/springframework/messaging/rsocket/MetadataEncoder.java
#	spring-messaging/src/main/java/org/springframework/messaging/simp/broker/OrderedMessageChannelDecorator.java
#	spring-messaging/src/main/java/org/springframework/messaging/simp/user/DefaultUserDestinationResolver.java
#	spring-test/src/main/java/org/springframework/test/web/servlet/request/MockHttpServletRequestBuilder.java
#	spring-web/src/main/java/org/springframework/http/HttpRange.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/socket/CloseStatus.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/RedirectViewControllerRegistration.java
2022-11-05 14:50:18 +01:00
Sam Brannen
5f02323b9c Avoid String allocations with Assert.isTrue() 2022-11-05 14:40:45 +01:00
Sam Brannen
d849f9816a Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/view/script/ScriptTemplateView.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/ScriptTemplateViewTests.java
2022-11-04 16:29:54 +01:00
Sam Brannen
a281d8c3fd Polishing 2022-11-04 16:24:59 +01:00
Sam Brannen
34b1857236 Avoid String allocations with Assert.state() 2022-11-04 15:51:32 +01:00
Sébastien Deleuze
bfe37c290e Refine PreComputeFieldFeature logging
Closes gh-29406
2022-11-02 07:57:49 +01:00
Johnny Lim
85d029f7c3 Polishing
Closes gh-29410
2022-11-01 15:22:49 +01:00
Sam Brannen
c3fca0a826 Always register root directory for registered resource hints
See gh-29403
2022-10-31 14:21:07 +01:00