Inspectopedia
 
2024.3

Utility class without 'private' constructor

Warning
New
Last modified: 03 December 2024

Reports utility classes without private constructors.

Utility classes have all fields and methods declared as static. Creating private constructors in utility classes prevents them from being accidentally instantiated.

Use the Ignore if annotated by option to specify special annotations. The inspection ignores classes marked with one of these annotations.

Use the Ignore classes with only a main method option to ignore classes with no methods other than the main one.