Inspectopedia Help

@Singleton constructors

Reports constructors of classes annotated by @Singleton unless it is declared non-strict.

Example:

@Singleton class Foo{ Foo(){ } }

There are two possible quick-fixes: either to remove the constructor or to declare @Singleton non-strict.

After the quick-fix is applied:

@Singleton class Foo{ }

or:

@Singleton(strict = false) class Foo{ Foo(){ } }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Groovy, 241.14841

Last modified: 12 March 2024