Uploaded image for project: 'Google Code-in'
  1. Google Code-in
  2. GCI-260

Add a private constructor to utility classes

    XMLWordPrintable

    Details

    • Complexity:
      Low

      Description

      UpgradeUtil.java, Security.java, PrivilegeConstants.java, RoleConstants.java, OpenmrsUtil.java, OpenmrsConstants.java, OpenmrsClassScanner.java, FormUtil.java, OpenmrsClassLoader.java, MemoryLeakUtil.java, FormConstants.java, ExceptionUtil.java, DateUtil.java, DatabaseUtil.java, SchedulerUtil.java, SchedulerConstants.java, OrderUtil.java, NotificationConstants.java, SqlDiffFileParser.java, ModuleUtil.java, LuceneAnalyzers.java, ModuleConstants.java, ModuleFactory.java, HibernateUtil.java, MigrationHelper.java, ServiceContext.java, DefaultMessageSourceServiceImpl.java, Daemon.java, HL7Util.java, CachePropertiesUtil.java, HL7Constants.java, TestInstallUtil.java, WebModuleUtil.java, AllergyConstants.java, CustomDatatypeUtil.java, ValidateUtil.java

      Background information:

      Utility classes, which are a collection of static members, are not meant to be instantiated. Even abstract utility classes, which can be extended, should not have public constructors.
      
      Java adds an implicit public constructor to every class which does not define at least one explicitly. Hence, at least one non-public constructor should be defined

       

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              navareth Bartłomiej Rasztabiga
              Reporter:
              dkayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: