Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Xlint:adviceDidNotMatch with iajc source at 1.5

I've dug out the bit in the doc

---
AspectJ 5 supports a new XLint warning, "the pointcut associated with
this advice does not match any join points". The warning is enabled by
default and will be emitted by the compiler if the pointcut expression
associated with an advice statement can be statically determined to
not match any join points.
---

It does mean the advice in your aspect will not execute as we couldn't
find anywhere to apply it.

cheers,
Andy


On 26/11/2007, Hartrey, Edel <Edel.Hartrey@xxxxxxx> wrote:
> Hi Andy,
>
> Thank you for your response.  From what you have said it does sound
> feasible that the advice never matched and the new compiler setting is
> only showing it up now, although the code did execute as expected
> previously.  Does the "adviceDidNotMatch" warning indicate that the
> aspect code will not execute as expected?  What is this message really
> telling us?
>
> I've looked at the pointcuts in the code and there are no object
> parameters that have primitive equivelents, nor vice versa, so from your
> explanation I'm guessing that this means autoboxing could not be
> occurring?  Please correct if I'm wrong with this.
>
> Thanks!
> -Edel
>
>
>
> -----Original Message-----
> From: aspectj-users-bounces@xxxxxxxxxxx
> [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Andy Clement
> Sent: Monday, November 26, 2007 4:17 PM
> To: aspectj-users@xxxxxxxxxxx
> Subject: Re: [aspectj-users] Xlint:adviceDidNotMatch with iajc source at
> 1.5
>
> Hi,
>
> The adviceDidNotMatch warning is an Xlint that is only produced when
> compiling in 'java5 mode' - and that is because when it gets
> irritating we provide an easy way to suppress it.  The following
> annotation can be attached to advice to stop it coming out.
>
> @SuppressAjWarnings({"adviceDidNotMatch"})
>
> The warning is indicating that you have some advice that does not
> match and probably has never matched, you just never knew at Java1.4
> level.
>
> If it really did match at Java1.4 but is not at Java1.5 then the only
> thing that can affect a match is auto-boxing.  Is it possible the
> joinpoints that are selected by your pointcuts could be getting
> autoboxing behaviour applied? ie. the auto promotion/demotion of
> primitive types to their object equivalents? (int<>Integer, etc).
>
> cheers,
> Andy.
>
> On 26/11/2007, Hartrey, Edel <Edel.Hartrey@xxxxxxx> wrote:
> > Hi there,
> >
> > I'm an AspectJ novice that has inherited some AspectJ code, and in the
> > process of an upgrade to Java 1.5 I've run into a problem that I would
> > greatly appreciate some insight into.
> >
> > The AspectJ code is only a small part of a larger codebase but it is
> > being moved from Java 1.4 to Java 1.5.  When I compiled the code with
> > iajc (AspectJ 1.5.3), with source attribute set to 1.5, I got the
> > following error for each location where around advice is being applied
> > in the code:
> >
> > [warning] advice defined in com.xxx.xxx.StrutsInterceptor has not been
> > applied [Xlint:adviceDidNotMatch]
> >
> > The code compiles without error or warning on iajc with source level
> set
> > to 1.4.
> >
> > The ant task that runs this compile is defined as follows:
> >         <iajc fork="true"
> >                 source="1.5"
> >               deprecation="@{deprecation}"
> >               debug="@{debug}"
> >               X="noInline"
> >               destdir="@{destdir}"
> >               classpathref="@{classpathref}"
> >               forkclasspathref="aspectj.classpath">
> >               <sourceroots>
> >                 <pathelement location="${iajc.src.dir1}"/>
> >               </sourceroots>
> >         </iajc>
> >
> > Any insight is appreciated,
> > Kind regards,
> > - Edel
> >
> >
> >
> >
> > _______________________________________________
> > 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
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top