Re: Checking that StringBuffer constructor not called with a char!
PELISSE Romain <[email protected]>
| Newsgroups | gmane.comp.java.audit.checkstyle.user |
|---|---|
| Message-ID | <14546411.1171360314152.JavaMail.www@wwumf0101> |
For Info, I did an "xpath rule" for PMD for this rule. It very easy to do this kind of stuff with PMD and Xpatah. ======================================== Date du message : févr. 13 2007, 09:18 AM De : "Xavier Outhier" <[email protected]> A : [email protected] Copie : Sujet : Re: [Checkstyle-user] Checking that StringBuffer constructor not called with a char! 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 _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user ------------------------------------------------------------------------- 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 _______________________________________________ Checkstyle-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/checkstyle-user