Re: Checking that StringBuffer constructor not called with a char!

Xavier Outhier <[email protected]>
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <[email protected]>
Oliver Burn wrote:
> This type of Check required deep type information that Checkstyle does 
> not collect. This type of Check is best written in FindBugs.
OK I will ask findbugs. I thought that as char is int findbugs would not 
be able to
find that the argument is a char and not an int but maybe I'm wrong. I 
don't know
how is written the bytecode.

Thank you.

Xavier.
>
> On 2/13/07, *Xavier Outhier * <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Hi all,
>
>     I've just watched to
>     http://www.denverjug.org/meetings/files/200408_Puzzles.pdf
>     (or the multimedia version:
>     http://www.javalobby.org/eps/more-puzzlers/).
>     Yes, that's not really new stuff.
>
>     Check new StringBuffer(char)
>     I was wondering if there is a way to configure checkstyle to check
>     if the constructor of StringBuffer is not called with a char that
>     is indeed
>     interpreted as an int and then set the size of the StringBuffer
>     and not
>     initilize with the string of one character
>     So new StringBuffer('M'); should provide a warning
>
>     Do I new to write my own checker?
>
>     Thanks for any tips,
>
>     Xavier.
>
[....]


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.