Reverted signature change on fromMultipartData

Reverted back from `MultiValueMap<String, Object>` to
`MultiValueMap<String, ?>`
This commit is contained in:
Arjen Poutsma 2018-01-10 17:41:09 +01:00
parent b36af8a11f
commit f7bf6460aa
1 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -250,9 +250,9 @@ public abstract class BodyInserters {
* @return a {@code BodyInserter} that writes multipart data
* @see MultipartBodyBuilder
*/
public static MultipartInserter fromMultipartData(MultiValueMap<String, Object> multipartData) {
public static MultipartInserter fromMultipartData(MultiValueMap<String, ?> multipartData) {
Assert.notNull(multipartData, "'multipartData' must not be null");
return new DefaultMultipartInserter().with(multipartData);
return new DefaultMultipartInserter().withInternal(multipartData);
}
/**
@ -477,8 +477,13 @@ public abstract class BodyInserters {
@Override
public MultipartInserter with(MultiValueMap<String, Object> values) {
return withInternal(values);
}
@SuppressWarnings("unchecked")
private MultipartInserter withInternal(MultiValueMap<String, ?> values) {
Assert.notNull(values, "'values' must not be null");
for (Map.Entry<String, List<Object>> entry : values.entrySet()) {
for (Map.Entry<String, ? extends List<?>> entry : values.entrySet()) {
for (Object value : entry.getValue()) {
this.builder.part(entry.getKey(), value);
}