Skip to content

Locale parameter in MessageSource#getMessage methods should be nullable #35230

@dougbreaux

Description

@dougbreaux

My IDE is complaining that I'm passing a null Locale value to:

String getMessage(String code, @Nullable Object[] args, Locale locale) throws NoSuchMessageException;

Which obviously does not have @Nullable, but the implementation definitely accepts null and uses the default Locale, which is what we want and have been doing with Spring 5.x.

And, in fact, AbstractMessageSource.getMessageInternal does have @Nullable:

protected String getMessageInternal(@Nullable String code, @Nullable Object[] args, @Nullable Locale locale) {

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions