Skip to content

Returning EmptyHolder from Cache causes ClassCastException [SPR-7736] #12392

@spring-projects-issues

Description

@spring-projects-issues

Chris Bonham opened SPR-7736 and commented

In the CacheAspectSupport class, if an EmptyHolder object is returned from the Cache, a ClassCastException can occur if the calling method expects a different type of object. I have created a patch that returns null if the EmptyHolder is returned. The check uses the EmptyHolder class since the actual EmptyHolder object could be from a separate JVM so an identity comparision with NULL_OBJECT won't work.


Affects: 3.1 M1

Attachments:

Referenced from: commits 8285e9c

Metadata

Metadata

Assignees

No one assigned

    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