|
1 | 1 | /* |
2 | | - * Copyright 2002-2017 the original author or authors. |
| 2 | + * Copyright 2002-2018 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * 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) { |
250 | 250 | * @return a {@code BodyInserter} that writes multipart data |
251 | 251 | * @see MultipartBodyBuilder |
252 | 252 | */ |
253 | | - public static MultipartInserter fromMultipartData(MultiValueMap<String, Object> multipartData) { |
| 253 | + public static MultipartInserter fromMultipartData(MultiValueMap<String, ?> multipartData) { |
254 | 254 | Assert.notNull(multipartData, "'multipartData' must not be null"); |
255 | | - return new DefaultMultipartInserter().with(multipartData); |
| 255 | + return new DefaultMultipartInserter().withInternal(multipartData); |
256 | 256 | } |
257 | 257 |
|
258 | 258 | /** |
@@ -477,8 +477,13 @@ public MultipartInserter with(String key, @Nullable Object value) { |
477 | 477 |
|
478 | 478 | @Override |
479 | 479 | public MultipartInserter with(MultiValueMap<String, Object> values) { |
| 480 | + return withInternal(values); |
| 481 | + } |
| 482 | + |
| 483 | + @SuppressWarnings("unchecked") |
| 484 | + private MultipartInserter withInternal(MultiValueMap<String, ?> values) { |
480 | 485 | 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()) { |
482 | 487 | for (Object value : entry.getValue()) { |
483 | 488 | this.builder.part(entry.getKey(), value); |
484 | 489 | } |
|
0 commit comments