Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7272

Enforce noninstantiability to all Utility classes

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: ALL COMPONENTS
    • Labels:
      None
    • Sprint:
      Community Day 2 - 2016

      Description

      I have discusses this in past on mailing list, that Utility, helper, worker classes which contains only static methods should not be instantiable. Also we can restrict it by adding a private constructor.

      Currently OFBiz has many such classes which should have private constructor. Identify all the *Worker.java, *.Helper.java, and *Util.java which do not have any non static method/member are eligible for having a private constructor.

      Reference why we should do this : http://www.informit.com/articles/article.aspx?p=1216151&seqNum=4

      1. OFBIZ-7272.patch
        54 kB
        Chinmay Patidar

        Issue Links

        1.
        Enforce noninstantiability to InvoiceWorker Class Sub-task Closed Arun Patidar
         
        2.
        Enforce noninstantiability to PaymentWorker class Sub-task Closed Arun Patidar
         
        3.
        Enforce noninstantiability to SagePayUtil class Sub-task Closed Arun Patidar
         
        4.
        Enforce noninstantiability to UtilAccounting Class Sub-task Closed Arun Patidar
         
        5.
        Enforce noninstantiability to ContentManagementWorker class Sub-task Closed Arun Patidar
         
        6.
        Enforce noninstantiability to LayoutWorker class Sub-task Closed Arun Patidar
         
        7.
        Enforce noninstantiability to OpenOfficeWorker class Sub-task Closed Arun Patidar
         
        8.
        Enforce noninstantiability to BOMHelper class Sub-task Closed Arun Patidar
         
        9.
        Enforce noninstantiability to ProductionRunHelper class Sub-task Closed Arun Patidar
         
        10.
        Enforce noninstantiability to SolrUtil Class Sub-task Closed Arun Patidar
         
        11.
        Enforce noninstantiability to ReportHelper class Sub-task Closed Arun Patidar
         
        12.
        Enforce noninstantiability to OrderChangeHelper class Sub-task Closed Arun Patidar
         
        13.
        Enforce noninstantiability to SearchWorker Class Sub-task Closed Arun Patidar
         
        14.
        Enforce noninstantiability to ProductDisplayWorker class Sub-task Closed Arun Patidar
         
        15.
        Enforce noninstantiability to BirtWorker Class Sub-task Closed Arun Patidar
         
        16.
        Enforce noninstantiability to UtilHelpText Class Sub-task Closed Arun Patidar
         
        17.
        Enforce noninstantiability to ProductPromoWorker class Sub-task Closed Arun Patidar
         
        18.
        Enforce noninstantiability to TaskWorker class Sub-task Closed Arun Patidar
         
        19.
        Enforce noninstantiability to PartyRelationshipHelper class Sub-task Closed Arun Patidar
         
        20.
        Enforce noninstantiability to WidgetPortalPageWorker Class Sub-task Closed Arun Patidar
         
        21.
        Enforce noninstantiability to WidgetDataResourceWorker Class Sub-task Closed Arun Patidar
         
        22.
        Enforce noninstantiability to PartyTypeHelper class Sub-task Closed Arun Patidar
         
        23.
        Enforce noninstantiability to SeoConfigUtil class Sub-task Closed Arun Patidar
         
        24.
        Enforce noninstantiability to WidgetContentWorker Class Sub-task Closed Arun Patidar
         
        25.
        Enforce noninstantiability to SeoUrlUtil class Sub-task Closed Arun Patidar
         
        26.
        Enforce noninstantiability to UtilCacheEvents Class Sub-task Closed Arun Patidar
         
        27.
        Enforce noninstantiability to ProductConfigWorker class Sub-task Closed Arun Patidar
         
        28.
        Enforce noninstantiability to WebSiteWorker Class Sub-task Closed Arun Patidar
         
        29.
        Enforce noninstantiability to ImageManagementHelper class Sub-task Closed Arun Patidar
         
        30.
        Enforce noninstantiability to InventoryWorker class Sub-task Closed Arun Patidar
         
        31.
        Enforce noninstantiability to ProductUtilServices class Sub-task Closed Arun Patidar
         
        32.
        Enforce noninstantiability to WebDavUtil Class Sub-task Closed Arun Patidar
         
        33.
        Enforce noninstantiability to ImportProductHelper class Sub-task Closed Arun Patidar
         
        34.
        Enforce noninstantiability to ApacheFopWorker Class Sub-task Closed Arun Patidar
         
        35.
        Enforce noninstantiability to ProductStoreWorker class Sub-task Closed Arun Patidar
         
        36.
        Enforce noninstantiability to ShipmentWorker class Sub-task Closed Arun Patidar
         
        37.
        Enforce noninstantiability to ProtectViewWorker Class Sub-task Closed Arun Patidar
         
        38.
        Enforce noninstantiability to WorkEffortWorker class Sub-task Closed Arun Patidar
         
        39.
        Enforce noninstantiability to ServiceMcaUtil Class Sub-task Closed Arun Patidar
         
        40.
        Enforce noninstantiability to BshUtil class Sub-task Closed Arun Patidar
         
        41.
        Enforce noninstantiability to FileUtil class Sub-task Closed Arun Patidar
         
        42.
        Enforce noninstantiability to KeyStoreUtil class Sub-task Closed Arun Patidar
         
        43.
        Enforce noninstantiability to SSLUtil class Sub-task Closed Arun Patidar
         
        44.
        Enforce noninstantiability to UtilDateTime class Sub-task Closed Arun Patidar
         
        45.
        Enforce noninstantiability to UtilFormatOut class Sub-task Closed Arun Patidar
         
        46.
        Enforce noninstantiability to UtilGenerics class Sub-task Closed Arun Patidar
         
        47.
        Enforce noninstantiability to UtilHttp class Sub-task Closed Arun Patidar
         
        48.
        Enforce noninstantiability to UtilIO class Sub-task Closed Arun Patidar
         
        49.
        Enforce noninstantiability to UtilJavaParse class Sub-task Closed Arun Patidar
         
        50.
        Enforce noninstantiability to UtilNumber class Sub-task Closed Arun Patidar
         
        51.
        Enforce noninstantiability to UtilPlist class Sub-task Closed Arun Patidar
         
        52.
        Enforce noninstantiability to UtilURL class Sub-task Closed Arun Patidar
         
        53.
        Enforce noninstantiability to ServiceEcaUtil class Sub-task Closed Arun Patidar
         
        54.
        Enforce noninstantiability to ServiceConfigUtil class Sub-task Closed Arun Patidar
         
        55.
        Enforce noninstantiability to RecurrenceUtil class Sub-task Closed Arun Patidar
         
        56.
        Enforce noninstantiability to EntityEcaUtil class Sub-task Closed Arun Patidar
         
        57.
        Enforce noninstantiability to KeywordSearchUtil class Sub-task Closed Arun Patidar
         
        58.
        Enforce noninstantiability to StatusWorker class Sub-task Closed Arun Patidar
         
        59.
        Enforce noninstantiability to PeriodWorker class Sub-task Closed Arun Patidar
         
        60.
        Enforce noninstantiability to PreferenceWorker class Sub-task Closed Arun Patidar
         
        61.
        Enforce noninstantiability to GeoWorker class Sub-task Closed Arun Patidar
         
        62.
        Enforce noninstantiability to AuthHelper class Sub-task Closed Arun Patidar
         
        63.
        Enforce noninstantiability to UrlServletHelper class Sub-task Closed Arun Patidar
         
        64.
        Enforce noninstantiability to EntityFinderUtil class Sub-task Closed Arun Patidar
         
        65.
        Enforce noninstantiability to SqlJdbcUtil class Sub-task Closed Arun Patidar
         
        66.
        Enforce noninstantiability to CommonWorkers class Sub-task Closed Arun Patidar
         
        67.
        Enforce noninstantiability to EntityTypeUtil class Sub-task Closed Arun Patidar
         
        68.
        Enforce noninstantiability to ModelUtil class Sub-task Closed Arun Patidar
         
        69.
        Enforce noninstantiability to EntityUtil class Sub-task Closed Arun Patidar
         
        70.
        Enforce noninstantiability to EntityUtilProperties class Sub-task Closed Arun Patidar
         
        71.
        Enforce noninstantiability to EntityGroupUtil class Sub-task Closed Arun Patidar
         
        72.
        Enforce noninstantiability to MiniLangUtil class Sub-task Closed Arun Patidar
         
        73.
        Enforce noninstantiability to CatalogWorker class Sub-task Closed Arun Patidar
         
        74.
        Enforce noninstantiability to CategoryWorker class Sub-task Closed Arun Patidar
         
        75.
        Enforce noninstantiability to ProductWorker class Sub-task Closed Arun Patidar
         
        76.
        Enforce noninstantiability to UtilMisc class Sub-task Closed Arun Patidar
         
        77.
        Enforce noninstantiability to UtilProperties class Sub-task Closed Arun Patidar
         
        78.
        Enforce noninstantiability to UtilValidate class Sub-task Closed Arun Patidar
         
        79.
        Enforce noninstantiability to UtilXml class Sub-task Closed Arun Patidar
         
        80.
        Enforce noninstantiability to UelUtil class Sub-task Closed Arun Patidar
         
        81.
        Enforce noninstantiability to FreeMarkerWorker class Sub-task Closed Arun Patidar
         
        82.
        Enforce noninstantiability to DatabaseUtil class Sub-task Closed Rishi Solanki
         
        83.
        Enforce noninstantiability to TransactionUtil class Sub-task Closed Arun Patidar
         
        84.
        Enforce noninstantiability to ServiceUtil class Sub-task Closed Arun Patidar
         
        85.
        Enforce noninstantiability to TemporalExpressionWorker class Sub-task Closed Arun Patidar
         
        86.
        Enforce noninstantiability to ProductUtil class Sub-task Closed Arun Patidar
         
        87.
        Enforce noninstantiability to CategoryUtil class Sub-task Closed Arun Patidar
         
        88.
        Enforce noninstantiability to ICalWorker class Sub-task Closed Arun Patidar
         
        89.
        Enforce noninstantiability to JNDIConfigUtil class Sub-task Closed Arun Patidar
         

          Activity

          Hide
          chinmay.patidar Chinmay Patidar added a comment -

          Here is the patch for the issue. Thanks Rishi Solanki and Arun Patidar for guidance and the discussion. Following are the classes on which added private constructor:

          applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
          applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java
          applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java
          applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
          applications/content/src/org/ofbiz/content/ContentManagementWorker.java
          applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
          applications/content/src/org/ofbiz/content/layout/LayoutWorker.java
          applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java
          applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java
          applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java
          applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java
          applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java
          applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
          applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
          applications/order/src/org/ofbiz/order/task/TaskWorker.java
          applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java
          applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java
          applications/product/src/org/ofbiz/product/category/SeoConfigUtil.java
          applications/product/src/org/ofbiz/product/category/SeoUrlUtil.java
          applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java
          applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementHelper.java
          applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java
          applications/product/src/org/ofbiz/product/product/ProductUtilServices.java
          applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java
          applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
          applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java
          applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java
          applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java
          framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java
          framework/base/src/org/ofbiz/base/util/BshUtil.java
          framework/base/src/org/ofbiz/base/util/FileUtil.java
          framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java
          framework/base/src/org/ofbiz/base/util/SSLUtil.java
          framework/base/src/org/ofbiz/base/util/UtilCodec.java
          framework/base/src/org/ofbiz/base/util/UtilDateTime.java
          framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
          framework/base/src/org/ofbiz/base/util/UtilGenerics.java
          framework/base/src/org/ofbiz/base/util/UtilHttp.java
          framework/base/src/org/ofbiz/base/util/UtilIO.java
          framework/base/src/org/ofbiz/base/util/UtilJavaParse.java
          framework/base/src/org/ofbiz/base/util/UtilNumber.java
          framework/base/src/org/ofbiz/base/util/UtilPlist.java
          framework/base/src/org/ofbiz/base/util/UtilProperties.java
          framework/base/src/org/ofbiz/base/util/UtilURL.java
          framework/base/src/org/ofbiz/base/util/UtilValidate.java
          framework/base/src/org/ofbiz/base/util/UtilXml.java
          framework/base/src/org/ofbiz/base/util/string/UelUtil.java
          framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java
          framework/common/src/org/ofbiz/common/CommonWorkers.java
          framework/common/src/org/ofbiz/common/KeywordSearchUtil.java
          framework/common/src/org/ofbiz/common/UrlServletHelper.java
          framework/common/src/org/ofbiz/common/authentication/AuthHelper.java
          framework/common/src/org/ofbiz/common/geo/GeoWorker.java
          framework/common/src/org/ofbiz/common/period/PeriodWorker.java
          framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java
          framework/common/src/org/ofbiz/common/status/StatusWorker.java
          framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java
          framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java
          framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java
          framework/entity/src/org/ofbiz/entity/model/ModelUtil.java
          framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java
          framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java
          framework/entity/src/org/ofbiz/entity/util/EntityUtil.java
          framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java
          framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java
          framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java
          framework/service/src/org/ofbiz/service/ServiceUtil.java
          framework/service/src/org/ofbiz/service/calendar/RecurrenceUtil.java
          framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java
          framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java
          framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java
          framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java
          framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java
          framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java
          framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java
          framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java
          framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java
          framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java
          framework/widget/src/org/ofbiz/widget/content/WidgetContentWorker.java
          framework/widget/src/org/ofbiz/widget/content/WidgetDataResourceWorker.java
          framework/widget/src/org/ofbiz/widget/portal/WidgetPortalPageWorker.java
          framework/widget/src/org/ofbiz/widget/renderer/UtilHelpText.java
          specialpurpose/birt/src/org/ofbiz/birt/BirtWorker.java
          specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java
          specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java
          specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java
          specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java
          
          Show
          chinmay.patidar Chinmay Patidar added a comment - Here is the patch for the issue. Thanks Rishi Solanki and Arun Patidar for guidance and the discussion. Following are the classes on which added private constructor: applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java applications/content/src/org/ofbiz/content/ContentManagementWorker.java applications/content/src/org/ofbiz/content/data/DataResourceWorker.java applications/content/src/org/ofbiz/content/layout/LayoutWorker.java applications/content/src/org/ofbiz/content/openoffice/OpenOfficeWorker.java applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java applications/marketing/src/org/ofbiz/marketing/report/ReportHelper.java applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java applications/order/src/org/ofbiz/order/task/TaskWorker.java applications/party/src/org/ofbiz/party/party/PartyRelationshipHelper.java applications/party/src/org/ofbiz/party/party/PartyTypeHelper.java applications/product/src/org/ofbiz/product/category/SeoConfigUtil.java applications/product/src/org/ofbiz/product/category/SeoUrlUtil.java applications/product/src/org/ofbiz/product/config/ProductConfigWorker.java applications/product/src/org/ofbiz/product/imagemanagement/ImageManagementHelper.java applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java applications/product/src/org/ofbiz/product/product/ProductUtilServices.java applications/product/src/org/ofbiz/product/spreadsheetimport/ImportProductHelper.java applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java applications/product/src/org/ofbiz/shipment/shipment/ShipmentWorker.java applications/workeffort/src/org/ofbiz/workeffort/workeffort/ICalWorker.java applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortWorker.java framework/base/src/org/ofbiz/base/config/JNDIConfigUtil.java framework/base/src/org/ofbiz/base/util/BshUtil.java framework/base/src/org/ofbiz/base/util/FileUtil.java framework/base/src/org/ofbiz/base/util/KeyStoreUtil.java framework/base/src/org/ofbiz/base/util/SSLUtil.java framework/base/src/org/ofbiz/base/util/UtilCodec.java framework/base/src/org/ofbiz/base/util/UtilDateTime.java framework/base/src/org/ofbiz/base/util/UtilFormatOut.java framework/base/src/org/ofbiz/base/util/UtilGenerics.java framework/base/src/org/ofbiz/base/util/UtilHttp.java framework/base/src/org/ofbiz/base/util/UtilIO.java framework/base/src/org/ofbiz/base/util/UtilJavaParse.java framework/base/src/org/ofbiz/base/util/UtilNumber.java framework/base/src/org/ofbiz/base/util/UtilPlist.java framework/base/src/org/ofbiz/base/util/UtilProperties.java framework/base/src/org/ofbiz/base/util/UtilURL.java framework/base/src/org/ofbiz/base/util/UtilValidate.java framework/base/src/org/ofbiz/base/util/UtilXml.java framework/base/src/org/ofbiz/base/util/string/UelUtil.java framework/base/src/org/ofbiz/base/util/template/FreeMarkerWorker.java framework/common/src/org/ofbiz/common/CommonWorkers.java framework/common/src/org/ofbiz/common/KeywordSearchUtil.java framework/common/src/org/ofbiz/common/UrlServletHelper.java framework/common/src/org/ofbiz/common/authentication/AuthHelper.java framework/common/src/org/ofbiz/common/geo/GeoWorker.java framework/common/src/org/ofbiz/common/period/PeriodWorker.java framework/common/src/org/ofbiz/common/preferences/PreferenceWorker.java framework/common/src/org/ofbiz/common/status/StatusWorker.java framework/entity/src/org/ofbiz/entity/finder/EntityFinderUtil.java framework/entity/src/org/ofbiz/entity/jdbc/DatabaseUtil.java framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java framework/entity/src/org/ofbiz/entity/model/ModelUtil.java framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java framework/entity/src/org/ofbiz/entity/util/EntityTypeUtil.java framework/entity/src/org/ofbiz/entity/util/EntityUtil.java framework/entity/src/org/ofbiz/entity/util/EntityUtilProperties.java framework/entityext/src/org/ofbiz/entityext/EntityGroupUtil.java framework/entityext/src/org/ofbiz/entityext/eca/EntityEcaUtil.java framework/service/src/org/ofbiz/service/ServiceUtil.java framework/service/src/org/ofbiz/service/calendar/RecurrenceUtil.java framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java framework/service/src/org/ofbiz/service/config/ServiceConfigUtil.java framework/service/src/org/ofbiz/service/eca/ServiceEcaUtil.java framework/service/src/org/ofbiz/service/mail/ServiceMcaUtil.java framework/start/src/org/ofbiz/base/start/StartupCommandUtil.java framework/webapp/src/org/ofbiz/webapp/control/ProtectViewWorker.java framework/webapp/src/org/ofbiz/webapp/view/ApacheFopWorker.java framework/webapp/src/org/ofbiz/webapp/webdav/WebDavUtil.java framework/webapp/src/org/ofbiz/webapp/website/WebSiteWorker.java framework/webtools/src/org/ofbiz/webtools/UtilCacheEvents.java framework/widget/src/org/ofbiz/widget/content/WidgetContentWorker.java framework/widget/src/org/ofbiz/widget/content/WidgetDataResourceWorker.java framework/widget/src/org/ofbiz/widget/portal/WidgetPortalPageWorker.java framework/widget/src/org/ofbiz/widget/renderer/UtilHelpText.java specialpurpose/birt/src/org/ofbiz/birt/BirtWorker.java specialpurpose/lucene/src/org/ofbiz/content/search/SearchWorker.java specialpurpose/solr/src/org/ofbiz/solr/CategoryUtil.java specialpurpose/solr/src/org/ofbiz/solr/ProductUtil.java specialpurpose/solr/src/org/ofbiz/solr/SolrUtil.java
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This is a good initiative, thanks guys!

          Show
          jacques.le.roux Jacques Le Roux added a comment - This is a good initiative, thanks guys!
          Hide
          pfm.smits Pierre Smits added a comment -

          If this has been discussed on the dev ml, please place the thread of that discussion in the description as well.

          Show
          pfm.smits Pierre Smits added a comment - If this has been discussed on the dev ml, please place the thread of that discussion in the description as well.
          Hide
          rishisolankii Rishi Solanki added a comment -

          Pierre Smits:

          Quick References:

          Taher,
          
          Thank you very much for your inputs. I was thinking to do the same to add private constructors first then do other things. But after your reply I think better to pick one class at a time, and check everything for that class which includes removing public modifiers, method and fields. Marking classes members as final and all your suggestions.
          
          We would start picking classes one by one, and check all its references and finally make necessary changes for each class. In that way we would be able to match the classes with purpose. This is better way to fix this design flaw.
          
          Thanks!
          
          
          
          Rishi Solanki
          Manager, Enterprise Software Development
          HotWax Systems Pvt. Ltd.
          Direct: +91-9893287847
          http://www.hotwaxsystems.com
          
          On Fri, Jun 10, 2016 at 5:00 PM, Taher Alkhateeb <slidingfilaments@gmail.com> wrote:
          
              Hi Rishi,
          
              I would suggest when refactoring such classes to apply everything that has
              to do with visibility including:
              - Removing public modifiers if not needed on class, method, and field levels
              - adding private where appropriate
              - marking classes, methods and fields as final where appropriate
              - marking method arguments as final where appropriate
          
              So I would consider a private constructor to be just one of a suite of
              activites that I call them collectively as visibility and mutability which
              are important to provide real isolation between the components with minimal
              dependencies.
          
              My 2 cents
          
              Taher Alkhateeb
          
              On Fri, Jun 10, 2016 at 2:22 PM, Rishi Solanki <rishisolankii@gmail.com>
              wrote:
          
              > Dear All,
              >
              > In past we did same for CatalogWorker, ProductWorker, CategoryWorker, and
              > UtilMisc classed. Now I think for all the utility, worker, helper classes
              > having only static members are eligible to have an private constructor with
              > them to make them non instantiable from anywhere.
              >
              > We have log an JIra and added patch for the same. So requesting you to take
              > a look at OFBIZ-7272 for more details and share your feedback in case we
              > can do the same for more classes or if any classes we have added should not
              > be in list.
              >
              > Thanks for your help in advance.
              >
              >
              > Rishi Solanki
              > Manager, Enterprise Software Development
              > HotWax Systems Pvt. Ltd.
              > Direct: +91-9893287847
              > http://www.hotwaxsystems.com
              >
          
          

          One old ticket id - https://issues.apache.org/jira/browse/OFBIZ-4656

          Show
          rishisolankii Rishi Solanki added a comment - Pierre Smits : Quick References: Taher, Thank you very much for your inputs. I was thinking to do the same to add private constructors first then do other things. But after your reply I think better to pick one class at a time, and check everything for that class which includes removing public modifiers, method and fields. Marking classes members as final and all your suggestions. We would start picking classes one by one, and check all its references and finally make necessary changes for each class. In that way we would be able to match the classes with purpose. This is better way to fix this design flaw. Thanks! Rishi Solanki Manager, Enterprise Software Development HotWax Systems Pvt. Ltd. Direct: +91-9893287847 http: //www.hotwaxsystems.com On Fri, Jun 10, 2016 at 5:00 PM, Taher Alkhateeb <slidingfilaments@gmail.com> wrote: Hi Rishi, I would suggest when refactoring such classes to apply everything that has to do with visibility including: - Removing public modifiers if not needed on class, method, and field levels - adding private where appropriate - marking classes, methods and fields as final where appropriate - marking method arguments as final where appropriate So I would consider a private constructor to be just one of a suite of activites that I call them collectively as visibility and mutability which are important to provide real isolation between the components with minimal dependencies. My 2 cents Taher Alkhateeb On Fri, Jun 10, 2016 at 2:22 PM, Rishi Solanki <rishisolankii@gmail.com> wrote: > Dear All, > > In past we did same for CatalogWorker, ProductWorker, CategoryWorker, and > UtilMisc classed. Now I think for all the utility, worker, helper classes > having only static members are eligible to have an private constructor with > them to make them non instantiable from anywhere. > > We have log an JIra and added patch for the same. So requesting you to take > a look at OFBIZ-7272 for more details and share your feedback in case we > can do the same for more classes or if any classes we have added should not > be in list. > > Thanks for your help in advance. > > > Rishi Solanki > Manager, Enterprise Software Development > HotWax Systems Pvt. Ltd. > Direct: +91-9893287847 > http: //www.hotwaxsystems.com > One old ticket id - https://issues.apache.org/jira/browse/OFBIZ-4656
          Hide
          pandeypranay Pranay Pandey added a comment -

          Hi Rishi, Arun

          I think you should add details of tickets to Refactoring Effort document here in Confluence.
          https://cwiki.apache.org/confluence/display/OFBIZ/Framework+Re-factor

          Show
          pandeypranay Pranay Pandey added a comment - Hi Rishi, Arun I think you should add details of tickets to Refactoring Effort document here in Confluence. https://cwiki.apache.org/confluence/display/OFBIZ/Framework+Re-factor
          Hide
          rishisolankii Rishi Solanki added a comment -

          thanks!

          Show
          rishisolankii Rishi Solanki added a comment - thanks!
          Hide
          rishisolankii Rishi Solanki added a comment -

          Thanks Pranay for the note, we have plan the same to add details on confluence. We will surely add details around it soon.

          Show
          rishisolankii Rishi Solanki added a comment - Thanks Pranay for the note, we have plan the same to add details on confluence. We will surely add details around it soon.
          Hide
          arunpati Arun Patidar added a comment -

          Hi Rishi Solanki

          I have committed all patches available on sub tickets. Please let me know if some classes still remains to update in this effort.

          Show
          arunpati Arun Patidar added a comment - Hi Rishi Solanki I have committed all patches available on sub tickets. Please let me know if some classes still remains to update in this effort.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          I reviewed all the commits, thanks for the excellent and long work!

          Show
          jacques.le.roux Jacques Le Roux added a comment - I reviewed all the commits, thanks for the excellent and long work!
          Hide
          rishisolankii Rishi Solanki added a comment -

          Jacques Le Roux: Thanks for review and feedback, it is like energy booster for us.

          Arun Patidar: I have extracted few more classes which are under discussion, I'll sync with you on this in next week and try to complete the effort.

          Show
          rishisolankii Rishi Solanki added a comment - Jacques Le Roux : Thanks for review and feedback, it is like energy booster for us. Arun Patidar : I have extracted few more classes which are under discussion, I'll sync with you on this in next week and try to complete the effort.
          Hide
          rishisolankii Rishi Solanki added a comment -

          Few more classes needs to be taken care or discuss;

          framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java
          framework/service/src/org/ofbiz/service/ServiceUtil.java
          framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java
          DataResourceWorker.java
          ProductUtil.java
          CategoryUtil.java
          StartupCommandUtil.java
          ICalWorker.java
          JNDIConfigUtil.java
          
          Show
          rishisolankii Rishi Solanki added a comment - Few more classes needs to be taken care or discuss; framework/entity/src/org/ofbiz/entity/transaction/TransactionUtil.java framework/service/src/org/ofbiz/service/ServiceUtil.java framework/service/src/org/ofbiz/service/calendar/TemporalExpressionWorker.java DataResourceWorker.java ProductUtil.java CategoryUtil.java StartupCommandUtil.java ICalWorker.java JNDIConfigUtil.java
          Hide
          arunpati Arun Patidar added a comment -

          Hi Rishi Solanki

          I have committed all the uploaded patches of sub-tasks. Please confirm if anything more remaining in this effort else I will close this ticket.

          Thanks to all for contribution.

          Show
          arunpati Arun Patidar added a comment - Hi Rishi Solanki I have committed all the uploaded patches of sub-tasks. Please confirm if anything more remaining in this effort else I will close this ticket. Thanks to all for contribution.
          Hide
          rishisolankii Rishi Solanki added a comment -

          Arun Patidar: Thanks for your help and committing all the changes. I have looked at all possible classes and seems to me all the classes we could think of have been covered now. No new classes from our side, I think we can close this ticket. In case we found any more class then we will reopen this one. Thanks!

          Show
          rishisolankii Rishi Solanki added a comment - Arun Patidar : Thanks for your help and committing all the changes. I have looked at all possible classes and seems to me all the classes we could think of have been covered now. No new classes from our side, I think we can close this ticket. In case we found any more class then we will reopen this one. Thanks!
          Hide
          arunpati Arun Patidar added a comment -

          Thanks Rishi Solanki for your comments. I am closing this ticket for now. Feel free to reopen in future if anything more need to add.

          Show
          arunpati Arun Patidar added a comment - Thanks Rishi Solanki for your comments. I am closing this ticket for now. Feel free to reopen in future if anything more need to add.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Congrats guys!

          Show
          jacques.le.roux Jacques Le Roux added a comment - Congrats guys!

            People

            • Assignee:
              arunpati Arun Patidar
              Reporter:
              rishisolankii Rishi Solanki
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile