Skip to content

Consistent null check on injection points for pre-existing singleton beans #34952

Closed
@jhoeller

Description

@jhoeller

In the course of #34929, it turned out that the common resolution code path does not perform a proper null bean check in case of a pre-existing singleton, due to a mismatch between the singleton retrieval optimization (which immediately turns a NullBean into null) and the instance resolution step (which still checks for NullBean). In #34929, we were bound to restore backwards compatibility for the shortcut code path even if this actually revealed a bug.

As a side note, this has not been reported by NullAway due to the unspecified nullability of Map.get access that we use internally. In any case, this needs to be addressed for 7.0 where it fits with the general JSpecify nullability revision.

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