Commit Graph

825 Commits

Author SHA1 Message Date
Sam Brannen
e4395f2f8b Clean up warnings and polishing 2022-07-31 14:14:56 +03:00
Arjen Poutsma
2aa74c9121 Deprecate ListenableFuture in favor of CompletableFuture
This commit deprecates ListenableFuture in favor of CompletableFuture.
ListenableFuture was introduced in Spring Framework 4.0, when
CompletableFuture was not yet available. Spring now requires JDK 17, so
having our own type no longer seems necessary.

Major changes in this commit include:
- Deprecation of ListenableFuture and related types
  (ListenableFutureCallback, SettableListenableFuture, etc.)
- Deprecation of AsyncListenableTaskExecutor in favor of default methods
  in AsyncTaskExecutor (submitCompletable).
- AsyncHandlerMethodReturnValueHandler now has toCompletableFuture
  instead of toListenableFuture.
- WebSocketClient now has execute methods, which do the same as
  doHandshake, but return CompletableFutures (cf. the reactive
  WebSocketClient).

All other changes
- add an overloaded method that takes a CompletableFuture parameter
  instead of ListenableFuture, and/or
- add a method with a 'Async' suffix that returns a CompletableFuture
  instead of a ListenableFuture (connectAsync, sendAsync).

Closes gh-27780
2022-07-27 12:41:35 +02:00
Stephane Nicoll
ae6a464a80 Merge branch '5.3.x' 2022-07-22 16:15:55 +02:00
Stephane Nicoll
421b5cb311 Polish "Deprecate SockJsServiceRegistration#setSupressCors"
See gh-28853
2022-07-22 16:07:47 +02:00
Marc Wrobel
1cc36e5be9 Deprecate SockJsServiceRegistration#setSupressCors
SockJsServiceRegistration#setSupressCors name contains a typo. It is
now deprecated in favor of a correctly spelled method, setSuppressCors.

See gh-28853
2022-07-22 16:06:54 +02:00
Stephane Nicoll
2c92d7da8f Harmonize RuntimeHintsRegistrar implementations
Closes gh-28801
2022-07-12 18:30:23 +02:00
Sam Brannen
7751c44487 Merge branch '5.3.x'
# Conflicts:
#	spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java
#	spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java
#	spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java
2022-07-11 21:37:13 +02:00
Marc Wrobel
03f0c57704 Fix and improve Javadoc in spring-websocket
Closes gh-28788
2022-07-11 21:30:32 +02:00
Arjen Poutsma
9b739a2310 Update scheduling package to use java.time
This commit deprecates all methods in org.springframework.scheduling
that use

- Date, in favor of variants that take an Instant.
- long & TimeUnit, in favor of variants that take a Duration.

Closes: gh-28714
2022-07-08 16:25:27 +02:00
rstoyanchev
a92b4279d7 Merge branch '5.3.x' 2022-07-04 16:52:16 +01:00
rstoyanchev
007bdede46 Add missing check to avoid re-initialization
Noticed during review of #28736 that a check protecting against
re-initialization was accidentally removed in commit
3d6e38bb43.
2022-07-04 16:17:57 +01:00
rstoyanchev
22cc6c5918 Polishing contribution
Closes gh-28736
2022-07-04 16:12:57 +01:00
CodeInDreams
461ba53b39 Qualify channelExecutor and taskScheduler in WebSocket config
See gh-28736
2022-07-04 15:51:40 +01:00
Johnny Lim
1205f53c4a Polish 2022-07-02 15:11:35 +09:00
Sébastien Deleuze
ecdd934658 Add runtime hints for AbstractHandshakeHandler
Closes gh-28697
2022-06-30 16:50:43 +02:00
Juergen Hoeller
4e1b9f1492 Replace deep exception message nesting with custom inclusion of cause messages
Includes deprecation of NestedServletException, whereas NestedCheckedException and NestedRuntimeException remain as base classes with several convenience methods.

Closes gh-25162
2022-06-14 14:00:28 +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
d45b5f6e8a Merge branch '5.3.x'
# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/resource/VersionResourceResolver.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/resource/VersionResourceResolver.java
2022-05-10 11:44:14 +02:00
Sam Brannen
1c10cdd1e8 Update copyright dates
See gh-28433
2022-05-10 11:33:32 +02:00
evgeny.bovykin
941b92cbed Make inner classes static when feasible
A static nested class does not keep an implicit reference to its
enclosing instance.

This prevents a common cause of memory leaks and uses less memory per
instance of the class.

Closes gh-28433
2022-05-10 11:32:37 +02:00
Juergen Hoeller
2b65f274dc Use Set.of instead of HashSet with Arrays.asList 2022-05-06 16:19:27 +02:00
Arjen Poutsma
28ac0d3883 Use HttpStatusCode interface
This commit contains changes made because of the introduction of
HttpStatusCode. In general, methods that used to return a HttpStatus
now return HttpStatusCode instead, and methods that returned raw status
codes are now deprecated.

See gh-28214
2022-03-23 12:49:38 +01:00
Stephane Nicoll
67b7c16bc0 Fix visibility of DefaultSockJsSchedulerContainer
Closes gh-28146
2022-03-09 16:38:10 +01:00
Sam Brannen
8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan
c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
rstoyanchev
4782d4c080 Merge branch '5.3.x' into main 2022-02-14 20:52:09 +00:00
rstoyanchev
11cb938232 Polishing contribution
Closes gh-28000
2022-02-14 20:51:02 +00:00
Ivan Zbykovskyi
f004bb1b64 Add formatting for SockJS GoAway frame
Prevents infinite loop for xhr-polling and xhr-streaming transports.

See gh-28000
2022-02-14 20:51:02 +00:00
rstoyanchev
7067461d71 Fix exception in Jetty10RequestUpgradeStrategy
Closes gh-27899
2022-01-12 15:04:05 +00:00
rstoyanchev
29fe109440 SockJS TaskScheduler container bean is package private
See gh-27903
2022-01-11 13:59:03 +00:00
rstoyanchev
368201975a Hide default SockJS TaskScheduler for @EnableWebSocket
Closes gh-27903
2022-01-11 10:16:27 +00:00
Sam Brannen
202b7ea47b Merge branch '5.3.x' 2022-01-04 15:17:05 +01:00
Sam Brannen
c3ce4f0f90 Polish contribution
See gh-27823
2022-01-04 15:12:29 +01:00
Marten Deinum
e1200f34e7 Use try-with-resources for AutoClosables where feasible
Where unfeasible, this commit adds inline comments to explain why
try-with-resources must not be used in certain scenarios. The purpose
of the comments is to avoid accidental conversion to try-with-resources
at a later date.

Closes gh-27823
2022-01-04 15:12:29 +01:00
liuzhifei
7021eb5bb1 Apply "instanceof pattern matching" in additional locations
Closes gh-27696
2022-01-03 16:52:38 +01:00
Rossen Stoyanchev
a15393836c Merge branch '5.3.x' into main 2021-12-09 15:35:21 +00:00
Rossen Stoyanchev
e9083d7d20 Apply LogFormatUtils in more places 2021-12-09 14:53:52 +00:00
Juergen Hoeller
7f43128a0e Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-web/src/main/java/org/springframework/web/server/MediaTypeNotSupportedStatusException.java
#	spring-web/src/main/java/org/springframework/web/util/ContentCachingRequestWrapper.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/HandlerMappingIntrospector.java
2021-12-03 22:42:05 +01:00
Juergen Hoeller
70974e006e Upgrade to Tomcat 9.0.55, Undertow 2.2.13, RxJava 3.1.3, SmallRye Mutiny 1.2, Joda-Time 2.10.13, JRuby 9.2.20.1, HtmlUnit 2.55, Checkstyle 9.2 2021-12-03 22:32:00 +01:00
Juergen Hoeller
4750a9430c Early removal of 5.x-deprecated code
Closes gh-27686
2021-11-18 09:18:06 +01:00
SungMin
32af39d6e6 Use 'toString(Charset)' instead of 'toString(String)' for encodings (#27646)
Co-authored-by: 홍성민(SungMin Hong)/Platform Engineering팀/11ST <devmonster@11stcorp.com>
2021-11-10 15:11:33 +01:00
Sam Brannen
b51813e408 Apply "instanceof pattern matching" in spring-websocket
This commit also applies additional clean-up tasks such as the following.

- final fields
- diamond operator (<>) for anonymous inner classes

This has only been applied to `src/main/java`.
2021-10-17 19:04:32 +02:00
Sam Brannen
93efb20a53 Fix broken links in Javadoc
This commit removes several links that were broken due to the removal
of various APIs in 6.0.

See gh-27480
2021-09-28 13:34:33 +02:00
Sam Brannen
16bf39ea1b Merge branch '5.3.x' 2021-09-28 10:35:18 +02:00
Sam Brannen
2567b20949 Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language
features, we are upgrading to a recent version of Checkstyle.

The latest version of spring-javaformat-checkstyle (0.0.28) is built
against Checkstyle 8.32 which does not include support for language
features such as text blocks. Support for text blocks was added in
Checkstyle 8.36.

In addition, there is a binary compatibility issue between
spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot
use Checkstyle 8.42 or higher.

In this commit, we therefore upgrade to spring-javaformat-checkstyle
0.0.28 and downgrade to Checkstyle 8.41.

This change is being applied to `5.3.x` as well as `main` in order to
benefit from the enhanced checking provided in more recent versions of
Checkstyle.

Closes gh-27481
2021-09-28 10:29:31 +02:00
Rossen Stoyanchev
48875dc44f Fix Jetty WebSocket test failures
See gh-27424
2021-09-17 14:53:09 +01:00
Juergen Hoeller
d84ca2ba90 Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
2021-09-17 09:14:07 +02:00
Sam Brannen
9f7a94058a Update copyright date
See gh-27298
2021-08-19 16:23:38 +02:00
LEE Juchan
caf6760ddd Fix grammatical errors in Javadoc
Closes gh-27298
2021-08-19 16:21:15 +02:00