Skip to content

Commit 0938909

Browse files
committed
Switch to Reactor 2022.0.0 snapshots
See gh-28766
1 parent a194fa0 commit 0938909

File tree

7 files changed

+18
-75
lines changed

7 files changed

+18
-75
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ configure(allprojects) { project ->
2929
imports {
3030
mavenBom "com.fasterxml.jackson:jackson-bom:2.13.3"
3131
mavenBom "io.netty:netty-bom:4.1.77.Final"
32-
mavenBom "io.projectreactor:reactor-bom:2022.0.0-M2"
32+
mavenBom "io.projectreactor:reactor-bom:2022.0.0-SNAPSHOT"
3333
mavenBom "io.r2dbc:r2dbc-bom:Borca-SR1"
3434
mavenBom "io.rsocket:rsocket-bom:1.1.2"
3535
mavenBom "org.eclipse.jetty:jetty-bom:11.0.9"
@@ -252,7 +252,7 @@ configure(allprojects) { project ->
252252
repositories {
253253
mavenCentral()
254254
maven { url "https://repo.spring.io/libs-spring-framework-build" }
255-
maven { url "https://repo.spring.io/milestone"}
255+
maven { url "https://repo.spring.io/snapshot"} // Reactor
256256
}
257257
}
258258
configurations.all {

spring-web/src/test/java/org/springframework/http/codec/multipart/MultipartHttpMessageWriterTests.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
2222
import java.util.Collections;
2323
import java.util.List;
2424
import java.util.Map;
25+
import java.util.concurrent.atomic.AtomicBoolean;
2526

2627
import org.junit.jupiter.api.Test;
2728
import reactor.core.publisher.Flux;
@@ -240,12 +241,13 @@ public void singleSubscriberWithResource() throws IOException {
240241

241242
@Test // SPR-16402
242243
public void singleSubscriberWithStrings() {
243-
@SuppressWarnings("deprecation")
244-
reactor.core.publisher.UnicastProcessor<String> processor = reactor.core.publisher.UnicastProcessor.create();
245-
Flux.just("foo", "bar", "baz").subscribe(processor);
244+
AtomicBoolean subscribed = new AtomicBoolean();
245+
Flux<String> publisher = Flux.just("foo", "bar", "baz")
246+
.doOnSubscribe(subscription ->
247+
assertThat(subscribed.compareAndSet(false, true)).isTrue());
246248

247249
MultipartBodyBuilder bodyBuilder = new MultipartBodyBuilder();
248-
bodyBuilder.asyncPart("name", processor, String.class);
250+
bodyBuilder.asyncPart("name", publisher, String.class);
249251

250252
Mono<MultiValueMap<String, HttpEntity<?>>> result = Mono.just(bodyBuilder.build());
251253

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/AbstractListenerWebSocketSession.java

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,10 +66,6 @@ public abstract class AbstractListenerWebSocketSession<T> extends AbstractWebSoc
6666
@Nullable
6767
private final Sinks.Empty<Void> handlerCompletionSink;
6868

69-
@Nullable
70-
@SuppressWarnings("deprecation")
71-
private final reactor.core.publisher.MonoProcessor<Void> handlerCompletionMono;
72-
7369
private final WebSocketReceivePublisher receivePublisher;
7470

7571
@Nullable
@@ -90,7 +86,7 @@ public abstract class AbstractListenerWebSocketSession<T> extends AbstractWebSoc
9086
public AbstractListenerWebSocketSession(
9187
T delegate, String id, HandshakeInfo info, DataBufferFactory bufferFactory) {
9288

93-
this(delegate, id, info, bufferFactory, (Sinks.Empty<Void>) null);
89+
this(delegate, id, info, bufferFactory, null);
9490
}
9591

9692
/**
@@ -105,25 +101,6 @@ public AbstractListenerWebSocketSession(T delegate, String id, HandshakeInfo inf
105101
super(delegate, id, info, bufferFactory);
106102
this.receivePublisher = new WebSocketReceivePublisher();
107103
this.handlerCompletionSink = handlerCompletionSink;
108-
this.handlerCompletionMono = null;
109-
}
110-
111-
/**
112-
* Alternative constructor with completion MonoProcessor to use to signal
113-
* when the handling of the session is complete, with success or error.
114-
* <p>Primarily for use with {@code WebSocketClient} to be able to
115-
* communicate the end of handling.
116-
* @deprecated as of 5.3 in favor of
117-
* {@link #AbstractListenerWebSocketSession(Object, String, HandshakeInfo, DataBufferFactory, Sinks.Empty)}
118-
*/
119-
@Deprecated
120-
public AbstractListenerWebSocketSession(T delegate, String id, HandshakeInfo info,
121-
DataBufferFactory bufferFactory, @Nullable reactor.core.publisher.MonoProcessor<Void> handlerCompletion) {
122-
123-
super(delegate, id, info, bufferFactory);
124-
this.receivePublisher = new WebSocketReceivePublisher();
125-
this.handlerCompletionMono = handlerCompletion;
126-
this.handlerCompletionSink = null;
127104
}
128105

129106

@@ -244,9 +221,6 @@ public void onError(Throwable ex) {
244221
// Ignore result: can't overflow, ok if not first or no one listens
245222
this.handlerCompletionSink.tryEmitError(ex);
246223
}
247-
if (this.handlerCompletionMono != null) {
248-
this.handlerCompletionMono.onError(ex);
249-
}
250224
close(CloseStatus.SERVER_ERROR.withReason(ex.getMessage()));
251225
}
252226

@@ -256,9 +230,6 @@ public void onComplete() {
256230
// Ignore result: can't overflow, ok if not first or no one listens
257231
this.handlerCompletionSink.tryEmitEmpty();
258232
}
259-
if (this.handlerCompletionMono != null) {
260-
this.handlerCompletionMono.onComplete();
261-
}
262233
close();
263234
}
264235

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/JettyWebSocketSession.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public class JettyWebSocketSession extends AbstractListenerWebSocketSession<Sess
5050

5151

5252
public JettyWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory) {
53-
this(session, info, factory, (Sinks.Empty<Void>) null);
53+
this(session, info, factory, null);
5454
}
5555

5656
public JettyWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory,
@@ -61,13 +61,6 @@ public JettyWebSocketSession(Session session, HandshakeInfo info, DataBufferFact
6161
// suspendReceiving();
6262
}
6363

64-
@Deprecated
65-
public JettyWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory,
66-
@Nullable reactor.core.publisher.MonoProcessor<Void> completionMono) {
67-
68-
super(session, ObjectUtils.getIdentityHexString(session), info, factory, completionMono);
69-
}
70-
7164

7265
@Override
7366
protected boolean canSuspendReceiving() {

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/StandardWebSocketSession.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@
4646
public class StandardWebSocketSession extends AbstractListenerWebSocketSession<Session> {
4747

4848
public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory) {
49-
this(session, info, factory, (Sinks.Empty<Void>) null);
49+
this(session, info, factory, null);
5050
}
5151

5252
public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory,
@@ -55,13 +55,6 @@ public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferF
5555
super(session, session.getId(), info, factory, completionSink);
5656
}
5757

58-
@Deprecated
59-
public StandardWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory,
60-
@Nullable reactor.core.publisher.MonoProcessor<Void> completionMono) {
61-
62-
super(session, session.getId(), info, factory, completionMono);
63-
}
64-
6558

6659
@Override
6760
protected boolean canSuspendReceiving() {

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/TomcatWebSocketSession.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -53,14 +53,6 @@ public TomcatWebSocketSession(Session session, HandshakeInfo info, DataBufferFac
5353
suspendReceiving();
5454
}
5555

56-
@Deprecated
57-
public TomcatWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory,
58-
reactor.core.publisher.MonoProcessor<Void> completionMono) {
59-
60-
super(session, info, factory, completionMono);
61-
suspendReceiving();
62-
}
63-
6456

6557
@Override
6658
protected boolean canSuspendReceiving() {

spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/UndertowWebSocketSession.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@
4848
public class UndertowWebSocketSession extends AbstractListenerWebSocketSession<WebSocketChannel> {
4949

5050
public UndertowWebSocketSession(WebSocketChannel channel, HandshakeInfo info, DataBufferFactory factory) {
51-
this(channel, info, factory, (Sinks.Empty<Void>) null);
51+
this(channel, info, factory, null);
5252
}
5353

5454
public UndertowWebSocketSession(WebSocketChannel channel, HandshakeInfo info,
@@ -58,14 +58,6 @@ public UndertowWebSocketSession(WebSocketChannel channel, HandshakeInfo info,
5858
suspendReceiving();
5959
}
6060

61-
@Deprecated
62-
public UndertowWebSocketSession(WebSocketChannel channel, HandshakeInfo info,
63-
DataBufferFactory factory, @Nullable reactor.core.publisher.MonoProcessor<Void> completionMono) {
64-
65-
super(channel, ObjectUtils.getIdentityHexString(channel), info, factory, completionMono);
66-
suspendReceiving();
67-
}
68-
6961

7062
@Override
7163
protected boolean canSuspendReceiving() {

0 commit comments

Comments
 (0)