Skip to content

MessageSource.getMessage locale 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: enhancementA general enhancement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions