New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConcurrentModel.addAttribute(name, value) javadoc should not declare null value as acceptable [SPR-16831] #21371

Closed
spring-issuemaster opened this Issue May 17, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

spring-issuemaster commented May 17, 2018

David DELAMOTTE opened SPR-16831 and commented

According to the Spring documentation: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/ui/ConcurrentModel.html#addAttribute-java.lang.String-java.lang.Object-

This method is supposed to accept a null second parameter but there is an Assert.notNull that breaks this behaviour.

 


Affects: 5.0.6

Reference URL: https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/ui/ConcurrentModel.html#addAttribute-java.lang.String-java.lang.Object-

Issue Links:

  • #21383 Problem with passing null parameter to MapSqlParameterSource
  • #21678 BindingAwareConcurrentModel should properly react to null value

Referenced from: pull request #1830

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented May 17, 2018

David DELAMOTTE commented

Here is the pull request #1830

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented May 17, 2018

Juergen Hoeller commented

As mentioned on the PR, I've fixed the javadoc accordingly.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented May 21, 2018

Zhang Jie commented

ConcurrentModel.addAttribute(Object attributeValue) overrides Model.addAttribute(Object) whitch does not contain @Nullable (actually nonnull), maybe the @Nullable on ConcurrentModel.addAttribute(Object attributeValue) is not necessary.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator

spring-issuemaster commented Jul 4, 2018

Juergen Hoeller commented

Good catch, addAttribute(Object) indeed can be declared as non-null; this accidentally got copied over from addAttribute(String, Object). Since the backport to 5.0.7 unfortunately got missed, I'll roll this into 5.0.8 in its refined right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment