diff --git a/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java b/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java index 8ab6387b5b..1db9493465 100644 --- a/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java +++ b/spring-context/src/main/java/org/springframework/ui/ConcurrentModel.java @@ -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. @@ -68,7 +68,8 @@ public class ConcurrentModel extends ConcurrentHashMap implement /** * Add the supplied attribute under the supplied name. * @param attributeName the name of the model attribute (never {@code null}) - * @param attributeValue the model attribute value (can be {@code null}) + * @param attributeValue the model attribute value (never {@code null} for {@code ConcurrentModel}, + * with the {@code Nullable} declaration inherited from {@link Model#addAttribute(String, Object)}) */ public ConcurrentModel addAttribute(String attributeName, @Nullable Object attributeValue) { Assert.notNull(attributeName, "Model attribute name must not be null"); @@ -84,10 +85,11 @@ public class ConcurrentModel extends ConcurrentHashMap 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. - * @param attributeValue the model attribute value (never {@code null}) + * @param attributeValue the model attribute value (never {@code null} for {@code ConcurrentModel}, + * with the {@code Nullable} declaration inherited from {@link Model#addAttribute(String, Object)}) */ public ConcurrentModel addAttribute(@Nullable Object attributeValue) { - Assert.notNull(attributeValue, "Model object must not be null"); + Assert.notNull(attributeValue, "Model attribute value must not be null"); if (attributeValue instanceof Collection && ((Collection) attributeValue).isEmpty()) { return this; }