Skip to content

Quick fix action to refactor field injection to constructor injection #522

Closed
@MahatmaFatalError

Description

@MahatmaFatalError

In general, field injection comes with some downsides http://olivergierke.de/2013/11/why-field-injection-is-evil/

Unfortunately, refactoring of old, grown code bases towards constructor injection is tedious. So I was looking for a refactoring automation (and apparently I was not the first one with this issue https://stackoverflow.com/questions/44008985/convert-spring-field-injection-to-constructor-injection-intellij-idea)

So in essence, a quick fix action on @Inject or @Autowired fields to create a new or extend an existing constructor (depending on (required = false) flag) would be really nice.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions