SandroMachado / openalpr-android

Android Automatic License Plate Recognition library (http://www.openalpr.com) ported for android.
Apache License 2.0
770 stars 272 forks source link

Code quality fix - Utility classes should not have public constructors. #26

Closed faisal-hameed closed 8 years ago

faisal-hameed commented 8 years ago

This pull request is focused on resolving occurrences of Sonar rule squid:S1118 - Utility classes should not have public constructors. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S1118

Please let me know if you have any questions.

Faisal Hameed

SandroMachado commented 8 years ago

The classes only have static methods, so they don't need a constructor.

faisal-hameed commented 8 years ago

@SandroMachado There are only static methods, that's why these classes should have private constructor so that no one can create instance of utility classes. Please check this sonar rule;

SandroMachado commented 8 years ago

@faisal-hameed they don't have a constructor, so they cannot be instantiated. Or am I missing something?

faisal-hameed commented 8 years ago

@SandroMachado Instance can be created of these classes with implicit default constructor so that's why we need to override default constructor and make it private.