You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2020/11/11 18:32:25 UTC

Checkstyle "Utility classes should not have a public or default constructor." error message

Hi,

Checkstyle returns 222 occurrences of the message "Utility classes should not have a public or default constructor."

This is due to https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor

I don't think we need to follow the "prevents calls from subclass" suggestion  there

I rather suggest to comment out the related class in checkstyle.xml:

ie <!-- <module name="HideUtilityClassConstructor"/> -->

If nobody is against, I'll do so in a week

Then should remain only 280 errors and hopefully most will be easy to fix. At least they will be easier to spot...

Jacques


Re: Checkstyle "Utility classes should not have a public or default constructor." error message

Posted by Jacques Le Roux <ja...@les7arts.com>.
Thanks Suraj and Aditya for your confirmations,

I guess you know already, I'm working on something else, so I will change
     tasks.checkstyleMain.maxErrors from 502 to 280 later...

Cheers

Jacques

Le 17/11/2020 à 13:30, Aditya Sharma a écrit :
> +1
>
> Thanks and Regards,
> Aditya Sharma
>
> On Thu, Nov 12, 2020 at 2:49 PM Suraj Khurana <su...@hotwax.co>
> wrote:
>
>> +1
>>
>> --
>> Best Regards,
>> Suraj Khurana
>> Senior Technical Consultant
>>
>>
>> On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
>> jacques.le.roux@les7arts.com> wrote:
>>
>>> Hi,
>>>
>>> Checkstyle returns 222 occurrences of the message "Utility classes should
>>> not have a public or default constructor."
>>>
>>> This is due to
>>>
>> https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor
>>> I don't think we need to follow the "prevents calls from subclass"
>>> suggestion  there
>>>
>>> I rather suggest to comment out the related class in checkstyle.xml:
>>>
>>> ie <!-- <module name="HideUtilityClassConstructor"/> -->
>>>
>>> If nobody is against, I'll do so in a week
>>>
>>> Then should remain only 280 errors and hopefully most will be easy to
>> fix.
>>> At least they will be easier to spot...
>>>
>>> Jacques
>>>
>>>

Re: Checkstyle "Utility classes should not have a public or default constructor." error message

Posted by Aditya Sharma <ad...@apache.org>.
+1

Thanks and Regards,
Aditya Sharma

On Thu, Nov 12, 2020 at 2:49 PM Suraj Khurana <su...@hotwax.co>
wrote:

> +1
>
> --
> Best Regards,
> Suraj Khurana
> Senior Technical Consultant
>
>
> On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
> jacques.le.roux@les7arts.com> wrote:
>
> > Hi,
> >
> > Checkstyle returns 222 occurrences of the message "Utility classes should
> > not have a public or default constructor."
> >
> > This is due to
> >
> https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor
> >
> > I don't think we need to follow the "prevents calls from subclass"
> > suggestion  there
> >
> > I rather suggest to comment out the related class in checkstyle.xml:
> >
> > ie <!-- <module name="HideUtilityClassConstructor"/> -->
> >
> > If nobody is against, I'll do so in a week
> >
> > Then should remain only 280 errors and hopefully most will be easy to
> fix.
> > At least they will be easier to spot...
> >
> > Jacques
> >
> >
>

Re: Checkstyle "Utility classes should not have a public or default constructor." error message

Posted by Suraj Khurana <su...@hotwax.co>.
+1

--
Best Regards,
Suraj Khurana
Senior Technical Consultant


On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> Hi,
>
> Checkstyle returns 222 occurrences of the message "Utility classes should
> not have a public or default constructor."
>
> This is due to
> https://checkstyle.sourceforge.io/config_design.html#HideUtilityClassConstructor
>
> I don't think we need to follow the "prevents calls from subclass"
> suggestion  there
>
> I rather suggest to comment out the related class in checkstyle.xml:
>
> ie <!-- <module name="HideUtilityClassConstructor"/> -->
>
> If nobody is against, I'll do so in a week
>
> Then should remain only 280 errors and hopefully most will be easy to fix.
> At least they will be easier to spot...
>
> Jacques
>
>