Re: unused local variables

KiranKumar <[email protected]> Tue, 8 Sep 2009 23:13:36 -0700 (PDT)
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Hi Arnaud,

I also have written a small check. But i'm not able to test due to lack of
knowledge in running the check. 

I have downloaded your jar file, but i didn't see an custom check xml
configuration file. 

Please let me know how to test custom checks and how to integrate them with
the existing check style in my local machine?

Thanks in advance.

Regards
Kiran


Arnaud Roques wrote:
> 
> Hello,
> 
> I have created two checkers:
> 
> <module name="cs.UnusedLocalVariable" />
> 	This checker detects unused local variable.
> 
> 
> <module name="cs.TooEarlyVariableDeclaration" />
> 
> 	This checker detects several things about variable declaration.
> Examples:
> 	int i = 0, j = 4; // Error: Declare variables on separate lines
> 
> 	int i;
> 	i = 4;  // those two lines can be merged into "int i = 4"
> 
> 
> 	int i = 0; // this affectation is useless
> 	i = 4;
> 
> 	int i; // Declare variable as close as possible to where they are
> used
> 	[A lot of code that does not use i]
> 	i = 6;
> 
> I've attached the "cs.jar" file that is needed to used thoses checkers.
> (sources are included).
> 
> The checkers have *not* been extensively tested, so use them with care.
> 
> Hope this helps!
> 
> 
> Arnaud Roques
> 
> 
>  
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
> 
> 

-- 
View this message in context: http://www.nabble.com/Re%3A-unused-local-variables-tp19267476p25359145.html
Sent from the CheckStyle - User mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july