Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Please help us to check if all our public methods call a known method or not, at compile-time

 --- Wes Isberg <wes@xxxxxxxxxxxxxx> a écrit : > Aimé
KASSA wrote:
>  > We intend to use AspectJ' static crosscutting
>  > mechanism to to implement behavior similar to the
> C
>  > #error preprocessor directive. We're just
> starting to
>  > use AspectJ...
>  >
>  > How to specify a pointcut allowing us to detect
> the
>  > absence of a call to MyClass.mandatoryMethod(..)
>  > inside all public methods (at compile-time)?
> 
> One refactoring is to do the mandatory call in
> advice
> (and optionally skip all the calls from your code
> until you find and remove them).
> 
> Implementing it with advice :
> 
>    before() : within(com.foo..*) && execution(public
> * *(..)) {
>       mandatoryCall();
>    }
> 
> Skipping any other calls made (if you can't remove
> them):
> 
>    void around(): within(com.foo..*) &&
> !within(Aspect)
>          && call(void mandatoryCall()) {
>       // no proceed();
>    }
> 
> As for finding methods that don't call this
> mandatory method,
> you might try another tool like JQuery.
> 
> Wes
> 
> 

Thank you ..


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com


Back to the top