Inspectopedia Help

@Singleton constructors

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


@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{ }


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

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Groovy, 233.SNAPSHOT

Last modified: 13 July 2023