Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is this a bug or my pointcut problem?

> So what you are saying then, that the fully qualified package
> declaration in my pointcut is unnecessary?   Yes/No

It's irrelevant whether you qualify the type using an import
or a fully-qualified name.

> The classes have no relationship to one another; they are not subclassed > from one another or even contain references to each other. They just
> happen to share the same method signature.

This is a bit unclear to me.

I assumed "com.naryx.tagfusion.cfm.tag.cfTag" was a type that
defines some method(s) "void render(..)"

But the type in the call PCD refers to the compile-time
type of the reference at the call site, not the type of the
class implementing the method.

So if the reference to the object is made through something
with a compile-time type of cfTag, and it is to a method
called "render" with a return type of void, the pointcut
will match.  (I've just never heard of someone specifying
the type in a call signature unless the method is defined
on the type.)

George's suggestion is a good one because it makes the
pointcut staticly-determinable so you can test it using

   declare warning : {pc} : "here";

For a description of how to debug pointcuts, see

  http://www.aspectcookbook.net/moin.cgi/DebugPointcutRecipe

(longish comment at the bottom)

Also, there's a FAQ entry on call v. execution, if you
haven't read it already.

Otherwise, if you reply, please write in code the actual
types and methods (sans bodies, etc.); that would help
others help you.

Thanks -
Wes


Alan Williamson wrote:
Thanks Wes for getting back to me.

However you've confused me further! ;)

The call signature is the same for overriding methods, so
the pointcut will pick out those methods as well.
Similarly for target: a subtype is an instance of that type.
So I suspect the pointcut is doing what you asked.


So what you are saying then, that the fully qualified package declaration in my pointcut is unnecessary? Yes/No

The classes have no relationship to one another; they are not subclassed from one another or even contain references to each other. They just happen to share the same method signature.

Surely that has to be a bug?

[what am i missing?]

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




Back to the top