Groovy
New instance of class annotated with @groovy.lang.Singleton
Warning
Sanity
New
Last modified: 03 December 2024Reports new instance creation of classes annotated with @groovy.lang.Singleton
. Such constructions can lead to runtime exception Can't instantiate singleton.
Example:
@Singleton
class Foo{
}
Foo foo = new Foo()
After the quick-fix is applied:
@Singleton
class Foo{
}
Foo foo = Foo.instance
- 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.
NewInstanceOfSingleton
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Groovy, 243.23126 |
Thanks for your feedback!
Was this page helpful?