Singleton Inspection

Compatible with IntelliJ IDEA
Dec 13, 2017
2 575

This inspection reports about (probably) inappropriate use of Singleton pattern.

Just write getInstance() method, and this inspection will check this class like a Singleton.

Singleton class should be checked for next errors:

  • Class should be final.
  • Class should have private constructor.
  • getInstance() method must be public and static and return instance of its class.

Download plugin

Recent change notes

#6 Fixed exception Short name 'Singleton' is not unique See release info for details https://github.com/stokito/IdeaSingletonInspection/releases/tag/v1.3

General usage instructions

Just write
getInstance() method, and this inspection will check this class like a Singleton. Singleton class should be checked for next errors:

  • Class should be final.

  • Class should have private constructor.

  • getInstance() method must be public and static and return instance of its class.