Browse Source

Fix accidental @Nullable declaration on addAttribute(Object)

Issue: SPR-16831
pull/1870/head
Juergen Hoeller 8 years ago
parent
commit
a5dd0f0c09
  1. 5
      spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java

5
spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java

@ -85,10 +85,9 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement @@ -85,10 +85,9 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* the model when using this method because we cannot correctly determine
* the true convention name. View code should check for {@code null} rather
* than for empty collections as is already done by JSTL tags.</i>
* @param attributeValue the model attribute value (never {@code null} for {@code ConcurrentModel},
* with the {@code Nullable} declaration inherited from {@link Model#addAttribute(String, Object)})
* @param attributeValue the model attribute value (never {@code null})
*/
public ConcurrentModel addAttribute(@Nullable Object attributeValue) {
public ConcurrentModel addAttribute(Object attributeValue) {
Assert.notNull(attributeValue, "Model attribute value must not be null");
if (attributeValue instanceof Collection && ((Collection<?>) attributeValue).isEmpty()) {
return this;

Loading…
Cancel
Save