Skip to content

Commit f7bf646

Browse files
committed
Reverted signature change on fromMultipartData
Reverted back from `MultiValueMap<String, Object>` to `MultiValueMap<String, ?>`
1 parent b36af8a commit f7bf646

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/function/BodyInserters.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 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.
@@ -250,9 +250,9 @@ public static FormInserter<String> fromFormData(String key, String value) {
250250
* @return a {@code BodyInserter} that writes multipart data
251251
* @see MultipartBodyBuilder
252252
*/
253-
public static MultipartInserter fromMultipartData(MultiValueMap<String, Object> multipartData) {
253+
public static MultipartInserter fromMultipartData(MultiValueMap<String, ?> multipartData) {
254254
Assert.notNull(multipartData, "'multipartData' must not be null");
255-
return new DefaultMultipartInserter().with(multipartData);
255+
return new DefaultMultipartInserter().withInternal(multipartData);
256256
}
257257

258258
/**
@@ -477,8 +477,13 @@ public MultipartInserter with(String key, @Nullable Object value) {
477477

478478
@Override
479479
public MultipartInserter with(MultiValueMap<String, Object> values) {
480+
return withInternal(values);
481+
}
482+
483+
@SuppressWarnings("unchecked")
484+
private MultipartInserter withInternal(MultiValueMap<String, ?> values) {
480485
Assert.notNull(values, "'values' must not be null");
481-
for (Map.Entry<String, List<Object>> entry : values.entrySet()) {
486+
for (Map.Entry<String, ? extends List<?>> entry : values.entrySet()) {
482487
for (Object value : entry.getValue()) {
483488
this.builder.part(entry.getKey(), value);
484489
}

0 commit comments

Comments
 (0)