« Return to Thread: Joinpoint method signature matches superclass and not the referenced class

Re: Joinpoint method signature matches superclass and not the referenced class

by stevebread :: Rate this Message:

Reply to Author | View in Thread


Hi Oliver, its not the constructor because if I have another class

@PublicAPI
class B
{
    public void doIt() {
    }
}

and call
new B().doIt();

that does not give me a warning.

I can even have
@PublicAPI
class B implements IB
{
    public void doIt() {
    }
}

public interface IB
{
}

and that does not give a warning.

Thanks,
Steve

--- On Tue, 6/23/09, Oliver Böhm <boehm@...> wrote:

> From: Oliver Böhm <boehm@...>
> Subject: Re: [aspectj-users] Joinpoint method signature matches superclass and not the referenced class
> To: aspectj-users@...
> Date: Tuesday, June 23, 2009, 7:09 AM
> Hello Steve,
>
> I guess, it is the constructor call "new C()" who causes
> the warning, because it has no annotation.
>
> rggards
> Oliver
>
>
>
> Steve reds schrieb:
> > Hi, I'm having trouble creating a method signature and
> I wonder if it is FaD.
> >
> > I'm trying to create a pattern for 'declare warning'
> that identifies all method calls to classes that do not have
> the annotation - @PublicAPI. The annotation is on the
> referenced class, not its methods.
> >
> > The pattern I am using is:
> > declare warning : call(* (!@PublicAPI *).*(..)) : "Non
> public API usage";
> >
> > In the following case I don't expect a warning but one
> is generated:
> >
> > public class Main
> > {
> >     public static void
> main(String[] args) {
> >         // Generates
> warning even though C is @PublicAPI
> >         new C().doIt();
> >     }
> > }
> >
> > @PublicAPI
> > class C implements IC
> > {
> >     public void doIt() {
> >     }
> > }
> >
> > public interface IC
> > {
> >     public void doIt();
> > }
> >
> > Shouldn't the signature match doIt() in C and not the
> one in IC since only C is referenced in Main?
> >
> > Thanks,
> > Steve
> >
> >
> >   
>    _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@...
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> -- Oliver Böhm
> http://www.javatux.de
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@...
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>



_______________________________________________
aspectj-users mailing list
aspectj-users@...
https://dev.eclipse.org/mailman/listinfo/aspectj-users

 « Return to Thread: Joinpoint method signature matches superclass and not the referenced class