From: <Lar...@pp...> - 2004-02-20 07:20:58
|
Yes, Checkstyle supports filters, see http://checkstyle.sourceforge.net/config.html#filters I've never used filters myself, but it seems that SuppressionFilter is what you are looking for. Lars > -----Original Message----- > From: Rumpf Michael [mailto:Mic...@en...] > Sent: Thursday, February 19, 2004 7:13 PM > To: Lar...@pp...; ck...@sy... > Cc: ope...@li... > Subject: RE: [openorb-devel] About making public classes final > > > Is there a way of specifying a per rule exclude list? > > I'm thinking of: > > <module ...> > <exclude pattern="**/examples/**"/> > </module> > > This means that the files matching the pattern will not be checked for > that rule. > > Michael > > > -----Original Message----- > From: ope...@li... > [mailto:ope...@li...] On Behalf Of > Lar...@pp... > Sent: Thursday, February 19, 2004 5:59 PM > To: ck...@sy... > Cc: ope...@li... > Subject: RE: [openorb-devel] About making public classes final > > Hi Joncheng, > > the checkstyle rules that generate these warnings are > > http://checkstyle.sourceforge.net/config_design.html#HideUtili > tyClassCon > stru > ctor > http://checkstyle.sourceforge.net/config_design.html#FinalClass > > SimpleExample only has static methods, hence it does not make sense to > let > it have a public constructor. There is simply no point in having > instances > of that class, because you cannot do anything useful with them. > > Now, if you make the constructor private, you implicitly make > the class > final. The FinalClass check reminds you to express that explicitly > instead > of implicitly. > > These two checks are designed to a generate a very clear API > (Javadoc). > In > our 'examples' code, clear source code may have a higher > priority than a > clear API, though... > > Lars > > > -----Original Message----- > > From: Joncheng Kuo [mailto:ck...@sy...] > > Sent: Thursday, February 19, 2004 3:57 PM > > To: Michael Rumpf > > Cc: ope...@li... > > Subject: [openorb-devel] About making public classes final > > > > > > Hi, Michael, > > > > I saw some checkstyle fixes about making public classes > final. What's > > the checkstyle warning and reason for making that change. > > > > In the following example, I don't see a reason for making a > > SimpleExample class final and having a private constructor. > > In general, > > I think what we want from doing checkstyle is clarity and > consistent > > coding style. We don't want to sacrifice clarity and > > simplicity just for > > pleasing the checkstyle program. What do you think? > > > > Joncheng > > > > /cvsroot/openorb/TimeService/src/examples/org/openorb/time/exa > > mples/simple/SimpleExample.java > > > > >Index: SimpleExample.java > > >=================================================================== > > >RCS file: > > /cvsroot/openorb/TimeService/src/examples/org/openorb/time/exa > > mples/simple/SimpleExample.java,v > > >retrieving revision 1.6 > > >retrieving revision 1.7 > > >diff -u -d -r1.6 -r1.7 > > >--- SimpleExample.java 24 Feb 2003 08:09:31 -0000 1.6 > > >+++ SimpleExample.java 19 Feb 2004 06:35:51 -0000 1.7 > > >@@ -11,8 +11,12 @@ > > > /** > > > * This class used to display the current time. > > > */ > > >-public class SimpleExample > > >+public final class SimpleExample > > > { > > >+ private SimpleExample() > > >+ { > > >+ } > > >+ > > > /** > > > * Connect to the Time Service > > > */ > > > > > > > > > > > >------------------------------------------------------- > > >SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > >Build and deploy apps & Web services for Linux with > > >a free DVD software kit from IBM. Click Now! > > >http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > > >_______________________________________________ > > >openorb-commits mailing list > > >ope...@li... > > >https://lists.sourceforge.net/lists/listinfo/openorb-commits > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > > Build and deploy apps & Web services for Linux with > > a free DVD software kit from IBM. Click Now! > > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > > _______________________________________________ > > openorb-devel mailing list > > ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openorb-devel > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > _______________________________________________ > openorb-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/openorb-devel > |