Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Weird syntax-error

Thanks for all your helpful advices and explanations. It's getting clearer now. The first results I'm getting with AspectJ in a real world project are amazing. Should have thought earlier about using it ;)...

kind regards
Tobias


> -----Ursprüngliche Nachricht-----
> Von: aspectj-users@xxxxxxxxxxx
> Gesendet: 15.09.07 01:24:00
> An: <aspectj-users@xxxxxxxxxxx>
> Betreff: RE: [aspectj-users] Weird syntax-error


> 
> You need a return type from around advice because it must return a value if
> the underlying join point does: the advice takes control at the join point
> and returns whatever it likes. In the case of a method with a void return
> this is less clear but consider if you want to use around advice for a
> cache: you need to be able to return a cached value without proceeding with
> the original join point.
> 
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Tobias Demuth
> Sent: Friday, September 14, 2007 3:43 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Weird syntax-error
> 
> Thanks for your help, your advice works fine. But why do I need a
> return-type here? In the book I'm reading about AspectJ I guess this is
> never mentioned ("Aspektorientierte Programmierung mit AspectJ 5" by Oliver
> Böhm, Amazon-users say it's the best German book about AspectJ available).
> 
> kind regards,
> Tobias
> 
> 
> > -----Ursprüngliche Nachricht-----
> > Von: aspectj-users@xxxxxxxxxxx
> > Gesendet: 14.09.07 12:24:57
> > An: aspectj-users@xxxxxxxxxxx
> > Betreff: Re: [aspectj-users] Weird syntax-error
> 
> 
> > 
> > That's a pain when you get that error.  The problem is simply that you
> > have no return type for the around advice.
> > 
> > void around() : executeStringSetter {
> >       System.out.println(thisJointPoint.toLongString());
> >     }
> > 
> > On 14/09/2007, Tobias Demuth <tobias_demuth@xxxxxx> wrote:
> > > Hello,
> > >
> > > my name is Tobias and I'm new to AspectJ and (of course) to this mailing
> list. I'm trying to get AspectJ to work together with my current project,
> but I have got an syntax error, which I don't understand and which I cannot
> reproduce in an easier (aka smaller) project.
> > >
> > > Here is my Aspect (the simplest version, that causes the error):
> > >
> > > public aspect ScriptingAspect {
> > >
> > >    pointcut executeStringSetter() :
> > >       execution(public void Cell.setRow(Row)); // Here comes the error.
> > >
> > >    around() : executeStringSetter {
> > >       System.out.println(thisJointPoint.toLongString());
> > >    }
> > >
> > > }
> > >
> > > The Classes Cell and Row are in the same Package as this Aspect. The
> error, the compiler shows to me, is:
> > >
> > > Syntax error on token ";", Type expected after this token
> > >
> > > I don't understand, what the compiler is arguing about. As I already
> said, I wasn't able to reproduce this error with an less complex project,
> which I can show to you anyway if requested.
> > >
> > > Thanks for any help or suggestions about the error,
> > > kind regards,
> > > Tobias
> > > _______________________________________________________________________
> > > Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
> > > kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
> > >
> > > _______________________________________________
> > > aspectj-users mailing list
> > > aspectj-users@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > >
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> > 
> 
> 
> __________________________________________________________________________
> Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!
> 
> Mehr Infos unter http://produkte.web.de/club/?mc=021131
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> 


_________________________________________________________________________
In 5 Schritten zur eigenen Homepage. Jetzt Domain sichern und gestalten! 
Nur 3,99 EUR/Monat! http://www.maildomain.web.de/?mc=021114



Back to the top