Singleton Inspection

Compatible with  IntelliJ IDEA
26.03.2013
3 059

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.

Please also see JPatterns library for patterns annotations.

Download plugin

Version

Update date

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.