language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/ClientResponse.java
@@ -108,59 +108,59 @@ public interface ClientResponse { /** * Extract the body to a {@code Mono}. - * @param typeReference a type reference describing the expected response body type + * @param elementTypeRef the type reference of element in the {@code Mono} * @param <T> the element type * @return a mono...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultClientResponse.java
@@ -132,8 +132,8 @@ public <T> Mono<T> bodyToMono(Class<? extends T> elementClass) { } @Override - public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) { - return body(BodyExtractors.toMono(typeReference)); + public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> elementTypeRef) { + r...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java
@@ -303,15 +303,15 @@ public RequestHeadersSpec<?> body(Object producer, Class<?> elementClass) { } @Override - public RequestHeadersSpec<?> body(Object producer, ParameterizedTypeReference<?> elementType) { - this.inserter = BodyInserters.fromProducer(producer, elementType); + public RequestHeadersSpec<?> ...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java
@@ -580,11 +580,11 @@ interface RequestBodySpec extends RequestHeadersSpec<RequestBodySpec> { * @param producer the producer to write to the request. This must be a * {@link Publisher} or another producer adaptable to a * {@code Publisher} via {@link ReactiveAdapterRegistry} - * @param elementType the typ...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/support/ClientResponseWrapper.java
@@ -103,8 +103,8 @@ public <T> Mono<T> bodyToMono(Class<? extends T> elementClass) { } @Override - public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) { - return this.delegate.bodyToMono(typeReference); + public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> elementTypeRef) { + retu...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilder.java
@@ -247,9 +247,9 @@ public Mono<ServerResponse> body(Object producer, Class<?> elementClass) { } @Override - public Mono<ServerResponse> body(Object producer, ParameterizedTypeReference<?> elementType) { + public Mono<ServerResponse> body(Object producer, ParameterizedTypeReference<?> elementTypeRef) { return ...
true
Other
spring-projects
spring-framework
08a5196c3ab34d8f8f7cc0f20383d6ba0a114832.json
Use elementClass and elementTypeRef consistently
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerResponse.java
@@ -418,11 +418,11 @@ interface BodyBuilder extends HeadersBuilder<BodyBuilder> { * @param producer the producer to write to the response. This must be a * {@link Publisher} or another producer adaptable to a * {@code Publisher} via {@link ReactiveAdapterRegistry} - * @param typeReference a type reference...
true
Other
spring-projects
spring-framework
88d7fede3618b2de12922bd9036c86d20bdc3b05.json
Avoid shadowed RSocketRequester extensions This commit renames RSocketRequester.RequestSpec data extension to dataWithType to avoid shadowing issues and adds Publisher<T> and Flow<T> variants to provide automatic reified type parameter resolution for those types. It also makes RSocketRequester consistent with the chan...
spring-messaging/src/main/kotlin/org/springframework/messaging/rsocket/RSocketRequesterExtensions.kt
@@ -22,6 +22,7 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.reactive.awaitFirstOrNull import kotlinx.coroutines.reactive.awaitSingle import kotlinx.coroutines.reactive.flow.asFlow +import org.reactivestreams.Publisher import org.springframework.core.ParameterizedTypeReference import reactor.cor...
true
Other
spring-projects
spring-framework
88d7fede3618b2de12922bd9036c86d20bdc3b05.json
Avoid shadowed RSocketRequester extensions This commit renames RSocketRequester.RequestSpec data extension to dataWithType to avoid shadowing issues and adds Publisher<T> and Flow<T> variants to provide automatic reified type parameter resolution for those types. It also makes RSocketRequester consistent with the chan...
spring-messaging/src/test/kotlin/org/springframework/messaging/rsocket/RSocketRequesterExtensionsTests.kt
@@ -3,6 +3,7 @@ package org.springframework.messaging.rsocket import io.mockk.every import io.mockk.mockk import kotlinx.coroutines.FlowPreview +import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.toList import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals @@ -12,6 +13,7 @@ im...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/spring-test.gradle
@@ -53,6 +53,8 @@ dependencies { optional("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}") optional("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}") optional("io.projectreactor:reactor-test") + optional("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutinesVersion}") + optional("org.jetbrains.ko...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClient.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -261,8 +261,20 @@ public RequestBodySpec ifN...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.springframework...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/main/kotlin/org/springframework/test/web/reactive/server/WebTestClientExtensions.kt
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,10 @@ package org.springframewo...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/ApplicationContextSpecTests.java
@@ -61,7 +61,7 @@ public RouterFunction<?> handler() { .GET("/sessionClassName", request -> request.session().flatMap(session -> { String className = session.getClass().getSimpleName(); - return ServerResponse.ok().syncBody(className); + return ServerResponse.ok().body(className); ...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ErrorTests.java
@@ -63,7 +63,7 @@ public void badRequestBeforeRequestBodyConsumed() { EntityExchangeResult<Void> result = this.client.post() .uri("/post") .contentType(MediaType.APPLICATION_JSON) - .syncBody(new Person("Dan")) + .body(new Person("Dan")) .exchange() .expectStatus().isBadRequest() .expe...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/JsonContentTests.java
@@ -82,7 +82,7 @@ public void jsonPathMatches() { public void postJsonContent() { this.client.post().uri("/persons") .contentType(MediaType.APPLICATION_JSON) - .syncBody("{\"name\":\"John\"}") + .body("{\"name\":\"John\"}") .exchange() .expectStatus().isCreated() .expectBody().isEmpty();
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/ResponseEntityTests.java
@@ -145,7 +145,7 @@ public void entityStream() { @Test public void postEntity() { this.client.post() - .syncBody(new Person("John")) + .body(new Person("John")) .exchange() .expectStatus().isCreated() .expectHeader().valueEquals("location", "/persons/John")
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/XmlContentTests.java
@@ -116,7 +116,7 @@ public void postXmlContent() { this.client.post().uri("/persons") .contentType(MediaType.APPLICATION_XML) - .syncBody(content) + .body(content) .exchange() .expectStatus().isCreated() .expectHeader().valueEquals(HttpHeaders.LOCATION, "/persons/John")
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/HttpServerTests.java
@@ -45,7 +45,7 @@ public class HttpServerTests { @Before public void start() throws Exception { HttpHandler httpHandler = RouterFunctions.toHttpHandler( - route(GET("/test"), request -> ServerResponse.ok().syncBody("It works!"))); + route(GET("/test"), request -> ServerResponse.ok().body("It works!"))); ...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/java/org/springframework/test/web/reactive/server/samples/bind/RouterFunctionTests.java
@@ -41,7 +41,7 @@ public class RouterFunctionTests { public void setUp() throws Exception { RouterFunction<?> route = route(GET("/test"), request -> - ServerResponse.ok().syncBody("It works!")); + ServerResponse.ok().body("It works!")); this.testClient = WebTestClient.bindToRouterFunction(route).build...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-test/src/test/kotlin/org/springframework/test/web/reactive/server/WebTestClientExtensionsTests.kt
@@ -18,10 +18,14 @@ package org.springframework.test.web.reactive.server import io.mockk.mockk import io.mockk.verify +import kotlinx.coroutines.FlowPreview +import kotlinx.coroutines.flow.Flow import org.junit.Assert.assertEquals import org.junit.Test import org.reactivestreams.Publisher +import org.springframe...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-web/src/main/java/org/springframework/http/client/MultipartBodyBuilder.java
@@ -41,7 +41,7 @@ /** * Builder for the body of a multipart request, producing * {@code MultiValueMap<String, HttpEntity>}, which can be provided to the - * {@code WebClient} through the {@code syncBody} method. + * {@code WebClient} through the {@code body} method. * * Examples: * <pre class="code"> @@ -67,...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/BodyInserters.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import reactor.core.publishe...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java
@@ -61,6 +61,7 @@ * * @author Rossen Stoyanchev * @author Brian Clozel + * @author Sebastien Deleuze * @since 5.0 */ class DefaultWebClient implements WebClient { @@ -290,16 +291,27 @@ public DefaultRequestBodyUriSpec ifNoneMatch(String... ifNoneMatches) { } @Override - public RequestHeadersSpec<?> ...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClient.java
@@ -30,6 +30,7 @@ import reactor.core.publisher.Mono; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.ReactiveAdapterRegistry; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; @@ -56,1...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilder.java
@@ -59,6 +59,7 @@ * * @author Arjen Poutsma * @author Juergen Hoeller + * @author Sebastien Deleuze * @since 5.0 */ class DefaultServerResponseBuilder implements ServerResponse.BodyBuilder { @@ -222,12 +223,9 @@ public Mono<ServerResponse> build( } @Override - public <T, P extends Publisher<T>> Mono<Se...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/EntityResponse.java
@@ -64,12 +64,38 @@ /** * Create a builder with the given object. - * @param t the object that represents the body of the response - * @param <T> the type of the elements contained in the publisher + * @param body the object that represents the body of the response + * @param <T> the type of the body + * @r...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerResponse.java
@@ -30,6 +30,7 @@ import reactor.core.publisher.Mono; import org.springframework.core.ParameterizedTypeReference; +import org.springframework.core.ReactiveAdapterRegistry; import org.springframework.http.CacheControl; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -38...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/client/WebClientExtensions.kt
@@ -16,14 +16,10 @@ package org.springframework.web.reactive.function.client -import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.FlowPreview -import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.reactive.awaitSingle import kotlinx.coroutines.reactive....
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/main/kotlin/org/springframework/web/reactive/function/server/ServerResponseExtensions.kt
@@ -19,7 +19,6 @@ package org.springframework.web.reactive.function.server import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.reactive.awaitSingle -import kotlinx.coroutines.reactive.flow.asPublisher import org.reactivestreams.Publisher import org.springframework.co...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/BodyInsertersTests.java
@@ -30,6 +30,7 @@ import java.util.Optional; import com.fasterxml.jackson.annotation.JsonView; +import io.reactivex.Single; import org.junit.Before; import org.junit.Test; import reactor.core.publisher.Flux; @@ -159,6 +160,51 @@ public void ofObjectWithHints() { .verify(); } + @Test + public void ofProd...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartIntegrationTests.java
@@ -61,7 +61,7 @@ public void multipartData() { Mono<ClientResponse> result = webClient .post() .uri("http://localhost:" + this.port + "/multipartData") - .syncBody(generateBody()) + .body(generateBody()) .exchange(); StepVerifier @@ -75,7 +75,7 @@ public void parts() { Mono<ClientRespon...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/client/DefaultWebClientTests.java
@@ -186,7 +186,7 @@ public void bodyObjectPublisher() { WebClient client = this.builder.build(); assertThatIllegalArgumentException().isThrownBy(() -> - client.post().uri("https://example.com").syncBody(mono)); + client.post().uri("https://example.com").body(mono)); } @Test
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
@@ -354,7 +354,7 @@ public void shouldSendPojoAsJson() { .uri("/pojo/capitalize") .accept(MediaType.APPLICATION_JSON) .contentType(MediaType.APPLICATION_JSON) - .syncBody(new Pojo("foofoo", "barbar")) + .body(new Pojo("foofoo", "barbar")) .retrieve() .bodyToMono(Pojo.class);
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DefaultEntityResponseBuilderTests.java
@@ -24,6 +24,7 @@ import java.util.List; import java.util.Set; +import io.reactivex.Single; import org.junit.Test; import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; @@ -76,6 +77,14 @@ public void fromPublisher() { assertThat(response.entity()).isSameAs(body); } + @Test + public voi...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/DefaultServerResponseBuilderTests.java
@@ -308,7 +308,7 @@ public void cookies() { public void copyCookies() { Mono<ServerResponse> serverResponse = ServerResponse.ok() .cookie(ResponseCookie.from("foo", "bar").build()) - .syncBody("body"); + .body("body"); assertThat(serverResponse.block().cookies().isEmpty()).isFalse(); @@ -360,15 +...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/InvalidHttpMethodIntegrationTests.java
@@ -33,8 +33,8 @@ public class InvalidHttpMethodIntegrationTests extends AbstractRouterFunctionInt @Override protected RouterFunction<?> routerFunction() { return RouterFunctions.route(RequestPredicates.GET("/"), - request -> ServerResponse.ok().syncBody("FOO")) - .andRoute(RequestPredicates.all(), request...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/NestedRouteIntegrationTests.java
@@ -125,7 +125,7 @@ private static class NestedHandler { public Mono<ServerResponse> pattern(ServerRequest request) { String pattern = matchingPattern(request).getPatternString(); - return ServerResponse.ok().syncBody(pattern); + return ServerResponse.ok().body(pattern); } @SuppressWarnings("unchec...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/MultipartIntegrationTests.java
@@ -85,7 +85,7 @@ public void requestPart() { Mono<ClientResponse> result = webClient .post() .uri("/requestPart") - .syncBody(generateBody()) + .body(generateBody()) .exchange(); StepVerifier @@ -99,7 +99,7 @@ public void requestBodyMap() { Mono<String> result = webClient .post() ...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/client/WebClientExtensionsTests.kt
@@ -27,6 +27,7 @@ import org.junit.Test import org.reactivestreams.Publisher import org.springframework.core.ParameterizedTypeReference import reactor.core.publisher.Mono +import java.util.concurrent.CompletableFuture /** * Mock object based tests for [WebClient] Kotlin extensions @@ -41,18 +42,26 @@ class WebC...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
spring-webflux/src/test/kotlin/org/springframework/web/reactive/function/server/ServerResponseExtensionsTests.kt
@@ -19,6 +19,7 @@ package org.springframework.web.reactive.function.server import io.mockk.every import io.mockk.mockk import io.mockk.verify +import io.reactivex.Flowable import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.runBlocking @@ -28,12 +29,14 @@ import org...
true
Other
spring-projects
spring-framework
2b4d6ce3548ddf97d1bce1a3832f480de9043fa7.json
Add body methods with Object parameter to WebFlux The commit deprecates syncBody(Object) in favor of body(Object) which has the same behavior in ServerResponse, WebClient and WebTestClient. It also adds body(Object, Class) and body(Object, ParameterizedTypeReference) methods in order to support any reactive type that ...
src/docs/asciidoc/web/webflux-webclient.adoc
@@ -318,7 +318,8 @@ is closed and is not placed back in the pool. [[webflux-client-body]] == Request Body -The request body can be encoded from an `Object`, as the following example shows: +The request body can be encoded from any asynchronous type handled by `ReactiveAdapterRegistry`, +like `Mono` as the following...
true
Other
spring-projects
spring-framework
0fbc9bf46189bc11abb67801f88cec1de29d0770.json
Fix broken Javadoc links
spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java
@@ -175,8 +175,8 @@ interface Builder { * <p>This is a shortcut for registering client handlers (i.e. annotated controllers) * to a {@link RSocketMessageHandler} and configuring it as an acceptor. * You can take full control by manually registering an acceptor on the - * {@link RSocketFactory.ClientRSocke...
true
Other
spring-projects
spring-framework
0fbc9bf46189bc11abb67801f88cec1de29d0770.json
Fix broken Javadoc links
spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
@@ -189,7 +189,7 @@ public FormHttpMessageConverter() { /** * Set the list of {@link MediaType} objects supported by this converter. - * @see #addSupportedMediaType(MediaType) + * @see #addSupportedMediaTypes(MediaType...) * @see #getSupportedMediaTypes() */ public void setSupportedMediaTypes(List<Medi...
true
Other
spring-projects
spring-framework
8bfc920ac53d2e914adb8882e55e5e2ec87bc85b.json
Fix typo in data-access.adoc Closes gh-23247
src/docs/asciidoc/data-access.adoc
@@ -1822,7 +1822,7 @@ settings by using Spring XML configuration: class="org.springframework.transaction.support.TransactionTemplate"> <property name="isolationLevelName" value="ISOLATION_READ_UNCOMMITTED"/> <property name="timeout" value="30"/> - </bean>" + </bean> ---- You can then inject the `sharedTra...
false
Other
spring-projects
spring-framework
0d3e5db3fff484a1d2812086044660b82c19c910.json
Compare suffix patterns by length Closes gh-23125
spring-core/src/main/java/org/springframework/util/AntPathMatcher.java
@@ -776,7 +776,10 @@ else if (pattern2EqualsPath) { return 1; } - if (info1.isPrefixPattern() && info2.getDoubleWildcards() == 0) { + if (info1.isPrefixPattern() && info2.isPrefixPattern()) { + return info2.getLength() - info1.getLength(); + } + else if (info1.isPrefixPattern() && info2.getDoubleW...
true
Other
spring-projects
spring-framework
0d3e5db3fff484a1d2812086044660b82c19c910.json
Compare suffix patterns by length Closes gh-23125
spring-core/src/test/java/org/springframework/util/AntPathMatcherTests.java
@@ -481,8 +481,9 @@ public void patternComparator() { assertThat(comparator.compare("/hotels/**", "/hotels/{hotel}/bookings/{booking}/cutomers/{customer}")).isEqualTo(1); assertThat(comparator.compare("/hotels/foo/bar/**", "/hotels/{hotel}")).isEqualTo(1); assertThat(comparator.compare("/hotels/{hotel}", "/hot...
true
Other
spring-projects
spring-framework
37f9ce5cc90644c8b157508c3370d1673c92af51.json
Return 500 (not 406) if content-type was preset If content-type is preset in the returned ResponseEntity, then any failure to find a matching converter is a server error. Closes gh-23205
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java
@@ -161,10 +161,17 @@ protected Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParame } } + MediaType contentType = exchange.getResponse().getHeaders().getContentType(); + if (contentType != null && contentType.equals(bestMediaType)) { + return Mono.error(new IllegalStateException( + "...
true
Other
spring-projects
spring-framework
37f9ce5cc90644c8b157508c3370d1673c92af51.json
Return 500 (not 406) if content-type was preset If content-type is preset in the returned ResponseEntity, then any failure to find a matching converter is a server error. Closes gh-23205
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/ResponseEntityResultHandlerTests.java
@@ -337,7 +337,7 @@ public void handleMonoWithWildcardBodyTypeAndNullBody() throws Exception { } @Test // SPR-17082 - public void handleResponseEntityWithExistingResponseHeaders() throws Exception { + public void handleWithPresetContentType() { ResponseEntity<Void> value = ResponseEntity.ok().contentType(Media...
true
Other
spring-projects
spring-framework
37f9ce5cc90644c8b157508c3370d1673c92af51.json
Return 500 (not 406) if content-type was preset If content-type is preset in the returned ResponseEntity, then any failure to find a matching converter is a server error. Closes gh-23205
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java
@@ -218,7 +218,8 @@ protected <T> void writeWithMessageConverters(@Nullable T value, MethodParameter MediaType selectedMediaType = null; MediaType contentType = outputMessage.getHeaders().getContentType(); - if (contentType != null && contentType.isConcrete()) { + boolean isContentTypePreset = contentType != ...
true
Other
spring-projects
spring-framework
37f9ce5cc90644c8b157508c3370d1673c92af51.json
Return 500 (not 406) if content-type was preset If content-type is preset in the returned ResponseEntity, then any failure to find a matching converter is a server error. Closes gh-23205
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/HttpEntityMethodProcessorMockTests.java
@@ -59,6 +59,7 @@ import static java.time.format.DateTimeFormatter.RFC_1123_DATE_TIME; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatIllegalStateException; import static org....
true
Other
spring-projects
spring-framework
932f771380db98f80c75ccb16cd122db1bfdc970.json
Improve performance of FormContentFilter Improve the performance of `FormContentFilter` by checking directly if `contentType` is empty. This saves the need for an exception to thrown then immediately caught. Closes gh-23216
spring-web/src/main/java/org/springframework/web/filter/FormContentFilter.java
@@ -109,16 +109,17 @@ public InputStream getBody() throws IOException { } private boolean shouldParse(HttpServletRequest request) { - if (!HTTP_METHODS.contains(request.getMethod())) { - return false; - } - try { - MediaType mediaType = MediaType.parseMediaType(request.getContentType()); - return MediaTy...
false
Other
spring-projects
spring-framework
b3d56ebf3b2dae906d13ae5cdd7f23b8945f3d85.json
Restore StringUtils.hasLength check Update `MimeTypeUtils` so that the StringUtils.hasLength check is performed immediately on the incoming argument, rather than in `parseMimeTypeInternal`. This restores the `IllegalArgumentException` rather than the `NullPointerException` which is thrown by the `ConcurrentHashMap`. ...
spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java
@@ -189,14 +189,13 @@ public abstract class MimeTypeUtils { * @throws InvalidMimeTypeException if the string cannot be parsed */ public static MimeType parseMimeType(String mimeType) { - return cachedMimeTypes.get(mimeType); - } - - private static MimeType parseMimeTypeInternal(String mimeType) { if (!Strin...
true
Other
spring-projects
spring-framework
b3d56ebf3b2dae906d13ae5cdd7f23b8945f3d85.json
Restore StringUtils.hasLength check Update `MimeTypeUtils` so that the StringUtils.hasLength check is performed immediately on the incoming argument, rather than in `parseMimeTypeInternal`. This restores the `IllegalArgumentException` rather than the `NullPointerException` which is thrown by the `ConcurrentHashMap`. ...
spring-core/src/test/java/org/springframework/util/MimeTypeTests.java
@@ -285,6 +285,12 @@ public void parseMimeTypeIllegalQuotedParameterValue() { MimeTypeUtils.parseMimeType("audio/*;attr=\"")); } + @Test + public void parseMimeTypeNull() { + assertThatExceptionOfType(InvalidMimeTypeException.class).isThrownBy(() -> + MimeTypeUtils.parseMimeType(null)); + } + @Test pub...
true
Other
spring-projects
spring-framework
87c15ba9ad7ddfd44163c298ed69a62559a3b681.json
Use the accepted profiles in BeanDefinitionDsl Closes gh-22393
spring-context/src/main/kotlin/org/springframework/context/support/BeanDefinitionDsl.kt
@@ -23,6 +23,7 @@ import org.springframework.beans.factory.getBeanProvider import org.springframework.beans.factory.support.BeanDefinitionReaderUtils import org.springframework.context.ApplicationContextInitializer import org.springframework.core.env.ConfigurableEnvironment +import org.springframework.core.env.Profi...
true
Other
spring-projects
spring-framework
87c15ba9ad7ddfd44163c298ed69a62559a3b681.json
Use the accepted profiles in BeanDefinitionDsl Closes gh-22393
spring-context/src/test/kotlin/org/springframework/context/support/BeanDefinitionDslTests.kt
@@ -170,6 +170,38 @@ class BeanDefinitionDslTests { context.getBean<Baz>() } + + @Test + fun `Declare beans with accepted profiles`() { + val beans = beans { + profile("foo") { bean<Foo>() } + profile("!bar") { bean<Bar>() } + profile("bar | barbar") { bean<BarBar>() } + profile("baz & buz") { bean<Baz...
true
Other
spring-projects
spring-framework
1b93ea97ac4fb7011e4afb026bb32d0c589aa198.json
Fix concurrent reads issue in MimeTypeUtils cache As of gh-22340, `MimeTypeUtils` has a built-in LRU cache implementation for caching parsed MIME types and avoiding excessive garbage creation at runtime. This implementation, when hit with highly concurrent reads on the same media type (the cache key), can create multi...
spring-core/src/main/java/org/springframework/util/MimeTypeUtils.java
@@ -443,6 +443,11 @@ public V get(K key) { } this.lock.writeLock().lock(); try { + // retrying in case of concurrent reads on the same key + if (this.queue.remove(key)) { + this.queue.add(key); + return this.cache.get(key); + } if (this.queue.size() == this.maxSize) { K leastUsed...
false
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
spring-web/src/main/java/org/springframework/http/converter/FormHttpMessageConverter.java
@@ -55,33 +55,76 @@ * write (but not read) the {@code "multipart/form-data"} media type as * {@link MultiValueMap MultiValueMap&lt;String, Object&gt;}. * + * <h3>Multipart Data</h3> + * + * <p>By default, {@code "multipart/form-data"} is used as the content type when + * {@linkplain #write writing} multipart data...
true
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
spring-web/src/test/java/org/springframework/http/converter/FormHttpMessageConverterTests.java
@@ -47,6 +47,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; +import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA; +import ...
true
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
spring-web/src/test/java/org/springframework/web/client/AbstractMockWebServerTestCase.java
@@ -35,13 +35,17 @@ import static org.springframework.http.HttpHeaders.CONTENT_LENGTH; import static org.springframework.http.HttpHeaders.CONTENT_TYPE; import static org.springframework.http.HttpHeaders.LOCATION; +import static org.springframework.http.MediaType.MULTIPART_FORM_DATA; /** * @author Brian Clozel ...
true
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
spring-web/src/test/java/org/springframework/web/client/AsyncRestTemplateIntegrationTests.java
@@ -49,6 +49,18 @@ import static org.assertj.core.api.Assertions.fail; /** + * Integration tests for {@link AsyncRestTemplate}. + * + * <h3>Logging configuration for {@code MockWebServer}</h3> + * + * <p>In order for our log4j2 configuration to be used in an IDE, you must + * set the following system property befor...
true
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
spring-web/src/test/java/org/springframework/web/client/RestTemplateIntegrationTests.java
@@ -54,6 +54,7 @@ import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; import org.springframework.http.client.SimpleClientHttpRequestFactory; +import org.springframework.http.converter.FormHttpMessageConverter; import ...
true
Other
spring-projects
spring-framework
5008423408dfd474a49240a5728c7790b8c24bff.json
Support multipart/* MediaTypes in RestTemplate Prior to this commit, RestTemplate posted multipart with Content-Type "multipart/form-data" even if the FormHttpMessageConverter configured in the RestTemplate had been configured to support additional multipart subtypes. This made it impossible to POST form data using a ...
src/docs/asciidoc/integration.adoc
@@ -1142,7 +1142,10 @@ request and response. By default, this converter supports all text media types | An `HttpMessageConverter` implementation that can read and write form data from the HTTP request and response. By default, this converter reads and writes the `application/x-www-form-urlencoded` media type. Form d...
true
Other
spring-projects
spring-framework
91ae711a541808ff28791da2e0f9bc8b06fd7ae7.json
Fix Javadoc for MediaType
spring-web/src/main/java/org/springframework/http/MediaType.java
@@ -432,7 +432,7 @@ public MediaType(MediaType other, Charset charset) { /** * Copy-constructor that copies the type and subtype of the given {@code MediaType}, - * and allows for different parameter. + * and allows for different parameters. * @param other the other media type * @param parameters the par...
false
Other
spring-projects
spring-framework
14afdb2bbcdeb2f1d34ec83025f819a64499faa4.json
Remove unnecessary import
spring-webflux/src/main/java/org/springframework/web/reactive/socket/adapter/ReactorNettyWebSocketSession.java
@@ -21,7 +21,6 @@ import reactor.core.publisher.Mono; import reactor.netty.NettyInbound; import reactor.netty.NettyOutbound; -import reactor.netty.NettyPipeline; import reactor.netty.http.websocket.WebsocketInbound; import reactor.netty.http.websocket.WebsocketOutbound;
false
Other
spring-projects
spring-framework
dda4dfb44ba0c76ab135a1255f99857c76f1c5ed.json
Clarify semantics of the PriorityOrdered interface This commit clarifies the semantics of the PriorityOrdered interface with respect to sorting sets of objects containing both PriorityOrdered and plain Ordered objects. Closes gh-23187
spring-core/src/main/java/org/springframework/core/PriorityOrdered.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,14 +18,19 @@ /** * Extension of the...
false
Other
spring-projects
spring-framework
0f1d16bb05d049281478cd355e6718c026f25e9c.json
Fix Checkstyle violation
spring-web/src/test/java/org/springframework/web/method/ControllerAdviceBeanTests.java
@@ -19,7 +19,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.List; - import javax.annotation.Priority; import org.junit.Test;
false
Other
spring-projects
spring-framework
dd15ff79d7223bb33c8e69558d69deb546aadfe1.json
Register annotated handlers in RSocketRequester Prior to this commit, there would be no easy way to register client RSocket handlers against an `RSocketRequester` instance. The only solution was to gather all handlers and wrap them in a `RSocketMessageHandler` and configure it as an acceptor on the client RSocket. Th...
spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequesterBuilder.java
@@ -18,17 +18,20 @@ import java.net.URI; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.function.Consumer; import java.util.stream.Stream; import io.rsocket.RSocketFactory; +import io.rsocket.frame.decoder.PayloadDecoder; import io.rsocket.transport.ClientTransp...
true
Other
spring-projects
spring-framework
dd15ff79d7223bb33c8e69558d69deb546aadfe1.json
Register annotated handlers in RSocketRequester Prior to this commit, there would be no easy way to register client RSocket handlers against an `RSocketRequester` instance. The only solution was to gather all handlers and wrap them in a `RSocketMessageHandler` and configure it as an acceptor on the client RSocket. Th...
spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java
@@ -30,6 +30,7 @@ import org.springframework.core.ParameterizedTypeReference; import org.springframework.core.ReactiveAdapterRegistry; import org.springframework.lang.Nullable; +import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler; import org.springframework.util.MimeType; /** @@...
true
Other
spring-projects
spring-framework
dd15ff79d7223bb33c8e69558d69deb546aadfe1.json
Register annotated handlers in RSocketRequester Prior to this commit, there would be no easy way to register client RSocket handlers against an `RSocketRequester` instance. The only solution was to gather all handlers and wrap them in a `RSocketMessageHandler` and configure it as an acceptor on the client RSocket. Th...
spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketServerToClientIntegrationTests.java
@@ -17,16 +17,12 @@ package org.springframework.messaging.rsocket; import java.time.Duration; -import java.util.Collections; import io.netty.buffer.PooledByteBufAllocator; -import io.rsocket.Closeable; -import io.rsocket.RSocket; import io.rsocket.RSocketFactory; import io.rsocket.frame.decoder.PayloadDecoder;...
true
Other
spring-projects
spring-framework
e3b3481c194abf03074ea4fe7d1ca8093e924e96.json
Fix typo in Javadoc
spring-core/src/main/java/org/springframework/core/DecoratingProxy.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ * class there anyway. * ...
false
Other
spring-projects
spring-framework
ed6fbdddaa32acd17668507fe2fd259e27f52633.json
Fix typo in CONTRIBUTING.md Closes gh-23180
CONTRIBUTING.md
@@ -40,7 +40,7 @@ and the conversations that result from it provide a continuous flow of ideas. Before you create a ticket, please take the time to [research first](#discuss). -If creating a ticket after a discussion on StackOverflow, please provide a self-sufficient description in the ticket, independent of the d...
false
Other
spring-projects
spring-framework
4568edf6c455f22c232dbfc1ed79ae263a99a7f4.json
Simplify ControllerAdviceBean constructors See gh-23163
spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java
@@ -47,14 +47,13 @@ public class ControllerAdviceBean implements Ordered { /** - * Declared as {@code Object} since this may be a reference to a - * {@code String} representing the bean name or a reference to the actual - * bean instance. + * Reference to the actual bean instance or a {@code String} representi...
true
Other
spring-projects
spring-framework
4568edf6c455f22c232dbfc1ed79ae263a99a7f4.json
Simplify ControllerAdviceBean constructors See gh-23163
spring-web/src/test/java/org/springframework/web/method/ControllerAdviceBeanTests.java
@@ -51,15 +51,15 @@ public void constructorPreconditions() { assertThatIllegalArgumentException() .isThrownBy(() -> new ControllerAdviceBean((String) null, null)) - .withMessage("Bean must not be null"); + .withMessage("Bean name must contain text"); assertThatIllegalArgumentException() .isThrownB...
true
Other
spring-projects
spring-framework
beb454a29952bc4f2fff533424c88105012039d6.json
Use HTTPS links in documentation where possible
src/docs/asciidoc/core/core-validation.adoc
@@ -1093,7 +1093,7 @@ The `number` package provides `NumberStyleFormatter`, `CurrencyStyleFormatter`, `PercentStyleFormatter` to format `Number` objects that use a `java.text.NumberFormat`. The `datetime` package provides a `DateFormatter` to format `java.util.Date` objects with a `java.text.DateFormat`. The `dateti...
true
Other
spring-projects
spring-framework
beb454a29952bc4f2fff533424c88105012039d6.json
Use HTTPS links in documentation where possible
src/docs/asciidoc/testing.adoc
@@ -6056,7 +6056,7 @@ See the following resources for more information about testing: using Java's proxy mechanism.`" Used by the Spring Framework in its test suite. * https://jmock.org/[JMock]: Library that supports test-driven development of Java code with mock objects. -* http://dbunit.sourceforge.net/[DbUnit...
true
Other
spring-projects
spring-framework
003247dc40dd0a194c69ce51aa64dd1a0dd69657.json
Equalize copy of ChannelSendOperator See gh-23175
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/reactive/ChannelSendOperator.java
@@ -246,7 +246,15 @@ public final void onComplete() { else if (this.state == State.NEW) { this.completed = true; this.state = State.FIRST_SIGNAL_RECEIVED; - writeFunction.apply(this).subscribe(this.writeCompletionBarrier); + Publisher<Void> result; + try { + result = writeFunction.appl...
false
Other
spring-projects
spring-framework
594c5806a6d33293194782c3b8a3e0ac8919195a.json
Handle error in apply of writeFunction Closes gh-23175
spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java
@@ -181,7 +181,15 @@ public final void onNext(T item) { else if (this.state == State.NEW) { this.item = item; this.state = State.FIRST_SIGNAL_RECEIVED; - writeFunction.apply(this).subscribe(this.writeCompletionBarrier); + Publisher<Void> result; + try { + result = writeFunction.apply(t...
true
Other
spring-projects
spring-framework
594c5806a6d33293194782c3b8a3e0ac8919195a.json
Handle error in apply of writeFunction Closes gh-23175
spring-web/src/test/java/org/springframework/http/server/reactive/ChannelSendOperatorTests.java
@@ -92,7 +92,7 @@ public void writeOneItem() throws Exception { @Test - public void writeMultipleItems() throws Exception { + public void writeMultipleItems() { List<String> items = Arrays.asList("one", "two", "three"); Mono<Void> completion = Flux.fromIterable(items).as(this::sendOperator); Signal<Void>...
true
Other
spring-projects
spring-framework
2759b4b909ab254ca2d6e3eb55a5b2374901c91b.json
Avoid use of Stream API in ControllerAdviceBean
spring-web/src/main/java/org/springframework/web/method/ControllerAdviceBean.java
@@ -16,9 +16,8 @@ package org.springframework.web.method; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; -import java.util.stream.Collectors; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryUtils; @@ -42,6 +41,7 @@ * @a...
false
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-test/src/main/java/org/springframework/mock/web/reactive/function/server/MockServerRequest.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -249,6 +249,13 @@ public Mono<MultiValueMap<...
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequest.java
@@ -220,6 +220,11 @@ public Mono<MultiValueMap<String, Part>> multipartData() { return this.exchange.getMultipartData(); } + @Override + public Flux<Part> parts() { + return this.exchange.getParts(); + } + private ServerHttpRequest request() { return this.exchange.getRequest(); }
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/DefaultServerRequestBuilder.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -290,8 +290,7 @@ private static class Delega...
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java
@@ -1025,6 +1025,11 @@ public Mono<MultiValueMap<String, Part>> multipartData() { return this.request.multipartData(); } + @Override + public Flux<Part> parts() { + return this.request.parts(); + } + @Override public ServerWebExchange exchange() { return this.request.exchange();
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -270,9 +270,23 @@ default String pathVariabl...
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/support/ServerRequestWrapper.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -208,6 +208,11 @@ public Mono<MultiValueMap<...
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/test/java/org/springframework/web/reactive/function/MultipartIntegrationTests.java
@@ -16,6 +16,10 @@ package org.springframework.web.reactive.function; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Map; import org.junit.Test; @@ -29,6 +33,7 @@ import org.springframework.http.codec.multipart.FilePart; imp...
true
Other
spring-projects
spring-framework
92981ac9dee2f8145b1253478264643df709cda9.json
Add Flux<Part> ServerRequest.parts() This commit introduces Flux<Part> ServerRequest.parts() that delegates to ServerWebExchange.getParts() and offers an alternative, streaming way of accessing multipart data. Closes gh-23131
spring-webflux/src/test/java/org/springframework/web/reactive/function/server/MockServerRequest.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -247,6 +247,13 @@ public Mono<MultiValueMap<...
true
Other
spring-projects
spring-framework
11c7907a596d97585699440538b478d6e0c7edcc.json
Add Flux<Part> ServerWebExchange.getParts() This commit introduces ServerWebExchange.getParts(), as an alternative, streaming way of accessing multipart data.
spring-web/src/main/java/org/springframework/web/server/ServerWebExchange.java
@@ -22,6 +22,7 @@ import java.util.function.Consumer; import java.util.function.Function; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import org.springframework.context.ApplicationContext; @@ -138,9 +139,23 @@ default <T> T getAttributeOrDefault(String name, T defaultValue) { * c...
true
Other
spring-projects
spring-framework
11c7907a596d97585699440538b478d6e0c7edcc.json
Add Flux<Part> ServerWebExchange.getParts() This commit introduces ServerWebExchange.getParts(), as an alternative, streaming way of accessing multipart data.
spring-web/src/main/java/org/springframework/web/server/ServerWebExchangeDecorator.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import java.util.Map; impor...
true
Other
spring-projects
spring-framework
11c7907a596d97585699440538b478d6e0c7edcc.json
Add Flux<Part> ServerWebExchange.getParts() This commit introduces ServerWebExchange.getParts(), as an alternative, streaming way of accessing multipart data.
spring-web/src/main/java/org/springframework/web/server/adapter/DefaultServerWebExchange.java
@@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ import java.util.concurrent....
true
Other
spring-projects
spring-framework
edd86e5dd556429f69f2098676867d77b7044116.json
Move RouterFunction WebHandler to inner class
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RouterFunctions.java
@@ -77,8 +77,6 @@ public abstract class RouterFunctions { RouterFunctions.class.getName() + ".matchingPattern"; - private static final HandlerFunction<ServerResponse> NOT_FOUND_HANDLER = - request -> ServerResponse.notFound().build(); /** @@ -253,43 +251,9 @@ public static WebHandler toWebHandler(Router...
false
Other
spring-projects
spring-framework
da582dad7c93ae13302bc3a5f50fd5e4a38dbdbc.json
Add documentation for Coroutines dependencies
src/docs/asciidoc/languages/kotlin.adoc
@@ -402,6 +402,21 @@ Spring Framework provides support for Coroutines on the following scope: * Suspending function and `Flow` support in RSocket `@MessageMapping` annotated methods * Extensions for {doc-root}/spring-framework/docs/{spring-version}/kdoc-api/spring-framework/org.springframework.messaging.rsocket/index...
false
Other
spring-projects
spring-framework
7d68a65dc07e960e6d373f5a258d3e8b80f87819.json
Replace deprecated methods in RSocket tests
spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketBufferLeakTests.java
@@ -86,7 +86,7 @@ public static void setupOnce() { server = RSocketFactory.receive() .frameDecoder(PayloadDecoder.ZERO_COPY) - .addServerPlugin(payloadInterceptor) // intercept responding + .addResponderPlugin(payloadInterceptor) // intercept responding .acceptor(context.getBean(RSocketMessageHandl...
true
Other
spring-projects
spring-framework
7d68a65dc07e960e6d373f5a258d3e8b80f87819.json
Replace deprecated methods in RSocket tests
spring-messaging/src/test/java/org/springframework/messaging/rsocket/RSocketClientToServerIntegrationTests.java
@@ -65,7 +65,7 @@ public static void setupOnce() { context = new AnnotationConfigApplicationContext(ServerConfig.class); server = RSocketFactory.receive() - .addServerPlugin(interceptor) + .addResponderPlugin(interceptor) .frameDecoder(PayloadDecoder.ZERO_COPY) .acceptor(context.getBean(RSocketM...
true
Other
spring-projects
spring-framework
d6b5c2005849e0676781ec1086bf8fc994e1a2c4.json
Generalize RSocketRequester data methods Replace the Publisher argument in RequestSpec's data(Publisher, Class<T>) and data(Publisher, ParameterizedTypeReference<T>) methods with Object thus allowing any reactive type known to the ReactiveAdapterRegistry to be passed in directly rather than adapted to Publisher first.
spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java
@@ -152,17 +152,21 @@ public ResponseSpec data(Object data) { } @Override - public <T, P extends Publisher<T>> ResponseSpec data(P publisher, Class<T> dataType) { - Assert.notNull(publisher, "'publisher' must not be null"); - Assert.notNull(dataType, "'dataType' must not be null"); - return toResponseSpe...
true
Other
spring-projects
spring-framework
d6b5c2005849e0676781ec1086bf8fc994e1a2c4.json
Generalize RSocketRequester data methods Replace the Publisher argument in RequestSpec's data(Publisher, Class<T>) and data(Publisher, ParameterizedTypeReference<T>) methods with Object thus allowing any reactive type known to the ReactiveAdapterRegistry to be passed in directly rather than adapted to Publisher first.
spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketRequester.java
@@ -200,41 +200,41 @@ interface RequestSpec { RequestSpec metadata(Object metadata, MimeType mimeType); /** - * Provide request payload data. The given Object may be a synchronous - * value, or a {@link Publisher} of values, or another async type that's - * registered in the configured {@link ReactiveAdap...
true
Other
spring-projects
spring-framework
22fd521e0aa9b18938b3e8be6070e2adf464ed84.json
Remove MessageHandlerAcceptor sub-class This commit removes the MessageHandlerAcceptor sub-class of RSocketMessageHandler, and rather than implementing directly the contracts for RSocket client and server acceptors, RSocketMessageHandler now exposes clientAcceptor() and serverAcceptor() methods that return the require...
spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java
@@ -254,7 +254,6 @@ private DataBuffer getMetadata() { dataBuffer instanceof NettyDataBuffer ? ((NettyDataBuffer) dataBuffer).getNativeBuffer() : Unpooled.wrappedBuffer(dataBuffer.asByteBuffer())); - }); return asDataBuffer(metadata); }
true
Other
spring-projects
spring-framework
22fd521e0aa9b18938b3e8be6070e2adf464ed84.json
Remove MessageHandlerAcceptor sub-class This commit removes the MessageHandlerAcceptor sub-class of RSocketMessageHandler, and rather than implementing directly the contracts for RSocket client and server acceptors, RSocketMessageHandler now exposes clientAcceptor() and serverAcceptor() methods that return the require...
spring-messaging/src/main/java/org/springframework/messaging/rsocket/MessageHandlerAcceptor.java
@@ -1,107 +0,0 @@ -/* - * Copyright 2002-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 ...
true
Other
spring-projects
spring-framework
22fd521e0aa9b18938b3e8be6070e2adf464ed84.json
Remove MessageHandlerAcceptor sub-class This commit removes the MessageHandlerAcceptor sub-class of RSocketMessageHandler, and rather than implementing directly the contracts for RSocket client and server acceptors, RSocketMessageHandler now exposes clientAcceptor() and serverAcceptor() methods that return the require...
spring-messaging/src/main/java/org/springframework/messaging/rsocket/RSocketMessageHandler.java
@@ -18,6 +18,13 @@ import java.util.ArrayList; import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Function; + +import io.rsocket.ConnectionSetupPayload; +import io.rsocket.RSocket; +import io.rsocket.SocketAcceptor; +import reactor.core.publisher.Mono; import org.springframe...
true