[jira] [Created] (OFBIZ-5055) Private constructor in UtilMisc and some other classes

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

[jira] [Created] (OFBIZ-5055) Private constructor in UtilMisc and some other classes

Nicolas Malin (Jira)
Martin Kaiser created OFBIZ-5055:
------------------------------------

             Summary: Private constructor in UtilMisc and some other classes
                 Key: OFBIZ-5055
                 URL: https://issues.apache.org/jira/browse/OFBIZ-5055
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: Release 10.04, SVN trunk
            Reporter: Martin Kaiser


I have noticed that in some Util (e.g. UtilMisc, UtilObject, StringUtil) classes in

framework/base/src/org/ofbiz/base/util/

private default constructors are used. By using a private default constructor it is impossible to make any extensions to this classes. I don't see any cause why this is necessary.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-5055) Private constructor in UtilMisc and some other classes

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-5055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13480134#comment-13480134 ]

Adrian Crum commented on OFBIZ-5055:
------------------------------------

This question should be asked on the user mailing list.

The private constructor is there because the class is a utility class with only static methods. Hence, you should not create an instance of it.

               

> Private constructor in UtilMisc and some other classes
> ------------------------------------------------------
>
>                 Key: OFBIZ-5055
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5055
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release 10.04, SVN trunk
>            Reporter: Martin Kaiser
>
> I have noticed that in some Util (e.g. UtilMisc, UtilObject, StringUtil) classes in
> framework/base/src/org/ofbiz/base/util/
> private default constructors are used. By using a private default constructor it is impossible to make any extensions to this classes. I don't see any cause why this is necessary.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-5055) Private constructor in UtilMisc and some other classes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Adrian Crum closed OFBIZ-5055.
------------------------------

    Resolution: Not A Problem
   

> Private constructor in UtilMisc and some other classes
> ------------------------------------------------------
>
>                 Key: OFBIZ-5055
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5055
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release 10.04, SVN trunk
>            Reporter: Martin Kaiser
>
> I have noticed that in some Util (e.g. UtilMisc, UtilObject, StringUtil) classes in
> framework/base/src/org/ofbiz/base/util/
> private default constructors are used. By using a private default constructor it is impossible to make any extensions to this classes. I don't see any cause why this is necessary.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Closed] (OFBIZ-5055) Private constructor in UtilMisc and some other classes

Martin Kaiser
Yes, you are right, zou should not make an instance of it. That is not
what was the intent of this bug. But you cannot make a derivative
class of it providing some other helpful methods. So in my opinion it
should be a protected constructor, not private.

On 19 October 2012 19:06, Adrian Crum (JIRA) <[hidden email]> wrote:

>
>      [ https://issues.apache.org/jira/browse/OFBIZ-5055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Adrian Crum closed OFBIZ-5055.
> ------------------------------
>
>     Resolution: Not A Problem
>
>> Private constructor in UtilMisc and some other classes
>> ------------------------------------------------------
>>
>>                 Key: OFBIZ-5055
>>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5055
>>             Project: OFBiz
>>          Issue Type: Bug
>>          Components: framework
>>    Affects Versions: Release 10.04, SVN trunk
>>            Reporter: Martin Kaiser
>>
>> I have noticed that in some Util (e.g. UtilMisc, UtilObject, StringUtil) classes in
>> framework/base/src/org/ofbiz/base/util/
>> private default constructors are used. By using a private default constructor it is impossible to make any extensions to this classes. I don't see any cause why this is necessary.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators
> For more information on JIRA, see: http://www.atlassian.com/software/jira