Skip to content

@Cacheable caches empty Optionals but documentation states otherwise #27184

@mwojterski

Description

@mwojterski

@Cacheable javadoc states:

Note that Java8's Optional return types are automatically handled and its content is stored in the cache if present. (...)

This seems to suggest only present optionals are cached, that's not true. English isn't my first lang, so please forgive if I misunderstood, I guess "if present" may refer to the cache.

spring-context v5.3.1

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: documentationA documentation task

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions