[jira] [Updated] (OFBIZ-7272) Enforce noninstantiability with a private constructor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-7272) Enforce noninstantiability with a private constructor

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-7272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chinmay Patidar updated OFBIZ-7272:
-----------------------------------
    Attachment: OFBIZ-7272.patch

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:
{code}
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
{code}

> Enforce noninstantiability with a private constructor
> -----------------------------------------------------
>
>                 Key: OFBIZ-7272
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-7272
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: Trunk
>            Reporter: Rishi Solanki
>         Attachments: OFBIZ-7272.patch
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)