Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » AspectJ - around advice and ProceedingJoinPoint(Using before and after advice works proper, but when I change it to around then there's a warning making the JoinPoint not working anymore)
AspectJ - around advice and ProceedingJoinPoint [message #1798750] Fri, 23 November 2018 13:49 Go to next message
Reza Payambari is currently offline Reza PayambariFriend
Messages: 5
Registered: November 2018
Junior Member
I'm new to AOP and I need to use AspectJ on my project. I need to use around advice but I have a problem using it, I've got the following code in my .aj class,

pointcut checkUser(ProceedingJoinPoint jp,User user): call(* com.example.UserAccount.MyUI.checkUser(..))&& args(jp,user);

void around(ProceedingJoinPoint jp,User user) throws Throwable : checkUser(jp,user){
    // Condition checks one of the user boolean property
    if(condition){
        jp.proceed();
    }else{
        // Do nothing
    }   
}


but I get this warning all the time,

advice defined in Aspects.UserAccount has not been applied [Xlint:adviceDidNotMatch]


By the way, I tried it without ProceedingJoinPoint and tried just proceed(); but then got this warning, too few arguments to proceed, expected 1

I'm thankful for any single help or hint!

Reza
Re: AspectJ - around advice and ProceedingJoinPoint [message #1798982 is a reply to message #1798750] Wed, 28 November 2018 10:16 Go to previous message
Reza Payambari is currently offline Reza PayambariFriend
Messages: 5
Registered: November 2018
Junior Member
I've got the answer I needed in www.stackoverflow.com and I'll send the link here in case of need for others.
https://stackoverflow.com/questions/53433710/aspectj-trouble-using-around-advice-and-proceedingjoinpoint#answer-53465379
Previous Topic:Vaadin and AspectJ - main() or init() - compilers integration
Next Topic: Create a new Aspect wizard giving error in AJDT.
Goto Forum:
  


Current Time: Fri Apr 19 23:30:28 GMT 2024

Powered by FUDForum. Page generated in 0.03533 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top