fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [fineract] thesmallstar opened a new pull request #1019: [WIP] FINERACT-821 Added and Enforced HideUtilityClassConstructor checkstyle
Date Tue, 09 Jun 2020 16:42:56 GMT

thesmallstar opened a new pull request #1019:
URL: https://github.com/apache/fineract/pull/1019


   HideUtilityClassConstructor  ->
   Utility Classes like Helperand Constants are forced to have all methods static, and constructor
non-public and non-default
   If we keep constructor protected we cannot create an object of that class but support inheritance
if required.  The other option was to use a private constructor(which won't support inheritance).
I have decided to go with protected constructor any contradicting views?
   
   The problems-> 
   1. Some Utility classes don't have all the methods static and also use "this" keyword inside
methods.
   Solution-> remove this keywords and make the method static.
   2. The constructor is used to set values in a utility class
   Solution -> Make another method to set values and make constructor protected. 
   3. Some methods return "this" 
   Solution-> Very suspicious on this, why is a utility class returning its instance? Still
looking into how to fix this.
   
   There are about 150-200 changes so can anyone please verify this approach? Do you see any
unintended side effects? 
   @vorburger @awasum @ptuomola @xurror @percyashu 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message