Skip to content

Improve Javadoc of ApplicationEvents #35297

@odrotbohm

Description

@odrotbohm

ApplicationEvents' Javadoc talks about using it via an autowired field before it talks about its use as method parameter. While not explicitly stated, this seems to create the impression that ApplicationEvents is a Spring bean generally eligible for dependency injection. Thus, developers seem to be puzzled to learn that they can not constructor-inject ApplicationEvents (see the (German) description here).

I think we should direct developers to use ApplicationEvents as a method parameter primarily as its lifecycle is per-method anyway.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions