Groovy
@Singleton constructors
Error
Reliability
New
Last modified: 03 December 2024Reports 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(){
}
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
SingletonConstructor
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Groovy, 243.23126 |
Thanks for your feedback!
Was this page helpful?