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

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

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

Jacques Le Roux
Administrator
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

Reply | Threaded
Open this post in threaded view
|

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

Suraj Khurana-2
+1

--
Best Regards,
Suraj Khurana
Senior Technical Consultant


On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
[hidden email]> 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
>
>
Reply | Threaded
Open this post in threaded view
|

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

adityasharma
+1

Thanks and Regards,
Aditya Sharma

On Thu, Nov 12, 2020 at 2:49 PM Suraj Khurana <[hidden email]>
wrote:

> +1
>
> --
> Best Regards,
> Suraj Khurana
> Senior Technical Consultant
>
>
> On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
> [hidden email]> 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
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

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

Jacques Le Roux
Administrator
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 <[hidden email]>
> wrote:
>
>> +1
>>
>> --
>> Best Regards,
>> Suraj Khurana
>> Senior Technical Consultant
>>
>>
>> On Thu, Nov 12, 2020 at 12:03 AM Jacques Le Roux <
>> [hidden email]> 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
>>>
>>>