Re: Forbid static method call

Romain PELISSE <[email protected]> Thu, 26 Nov 2009 17:37:13 +0100
Newsgroups gmane.comp.java.audit.checkstyle.user
Message-ID <20091126163713.GB3998@osc-portos>
Hi,

I think you can do this more easily using PMD (and writing an XPath rule) (http://pmd.sourceforge.net).

On Thu, Nov 26, 2009 at 04:44:39PM +0100, Leif Bladt (Inxmail GmbH) wrote:
> Hi,
> 
> I wonder if I can forbid the call of some specific static methods, like the JOptionPane.show... methods. I tried it with the IllegalToken check, but I couldn't manage to get it filtered on the needed method names. In fact it warned me about every single method call in the project :)
> 
> <module name="IllegalToken">
> 	<property name="tokens" value="METHOD_CALL"/>
> </module>
> 
> The DescendantToken check also didn't work. So is there as possibility I've overseen to get it done?
> 
> 
> Tahnks for your help,
> Leif
> 
> 
> -- 
> Software Developer
> 
> ------------------------------------------------------
> 
> Inxmail GmbH
> Wentzingerstr. 21, 79106 Freiburg, Germany
> Tel: +49 761 296979-0, Fax: -9
> [email protected], www.inxmail.de
> 
> 
> ------------------------------------------------------------------------------
> 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
> _______________________________________________
> Checkstyle-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/checkstyle-user
> 

-- 
Cordialement,
06.20.55.46.25
Romain PELISSE - Architecte Open Source chez Atos Origin

   Développement durable, anticipons pour notre avenir / Sustainibility,
   advance our future
   Préservons l'environnement, n'imprimez ce mail que si nécessaire /
   please consider your environmental responsibility before printing this
   e-mail.
   Ce message et les pièces jointes sont confidentiels et réservés à
   l'usage exclusif de ses destinataires. Il peut également être protégé
   par le secret professionnel. Si vous recevez ce message par erreur, merci
   d'en avertir immédiatement l'expéditeur et de le détruire.
   L'intégrité du message ne pouvant être assurée sur Internet, la
   responsabilité du groupe Atos Origin ne pourra être recherchée quant au
   contenu de ce message. Bien que les meilleurs efforts soient faits pour
   maintenir cette transmission exempte de tout virus, l'expéditeur ne donne
   aucune garantie à cet égard et sa responsabilité ne saurait être
   recherchée pour tout dommage résultant d'un virus transmis.

   This e-mail and the documents attached are confidential and intended
   solely for the addressee; it may also be privileged. If you receive this
   e-mail in error, please notify the sender immediately and destroy it. As
   its integrity cannot be secured on the Internet, the Atos Origin group
   liability cannot be triggered for the message content. Although the sender
   endeavours to maintain a computer virus-free network, the sender does not
   warrant that this transmission is virus-free and will not be liable for
   any damages resulting from any virus transmitted.

------------------------------------------------------------------------------
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