Re: [abc-users] abc's AspectJ compatibility

From: Thomas Pawlitzki <mailinglist_at_pawlitzki.name>
Date: Mon, 10 Mar 2008 09:02:19 +0100

Hi Eric,

> I am surprised that this code compiles correctly with ajc because
> indeed the compiler *should* throw an error. To me, this rather seems
> to be a bug in the ajc compiler. Here's why:
[...]

Yes, you are perfectly right. I did not look carefully enough on the
pointcut to notice that it match void-methods.

>
> The pointcut can only match calls to void methods. The around-advice
> however says that it returns a boolean. This is clearly a programming
> error and should be caught by the compiler. (Of course in case of
> AspectJ one can never tell for sure because there's not formal
> semantics :-( ) You should raise a bug report for that at:
> http://bugs.eclipse.org/bugs

The pointcut is defined as follows:
pointcut callUndoableSetRedoable(Undoable undoable, boolean newIsRedoable) :
                call(void Undoable.setRedoable(boolean)) &&
                args(newIsRedoable) &&
                target(undoable) &&
                if(false); //just to have no match for now

I think the if(false) is determinately. If i comment this out, also
the ajc throws error.
I guess that the ajc sees this condition and sees that this pointcut
will never match and does no detailed checks for this pointcut.

> This means that abc cannot find abc-runtime.jar. Is is on abc's classpath?

I am pretty sure that it is.

I call the abc as follows:

java -cp <abc-libs> abc.main.Main -classpath <ajhotdraw-libs>
-sourceroots ... -d ...

Now I added the abc-runtime.jar to the <ajhotdraw-libs> and i was able
to compile the sources.

Thanks for your help, Eric.

Greetings,
Thomas
Received on Mon Mar 10 2008 - 08:02:24 GMT

This archive was generated by hypermail 2.2.0 : Mon Mar 10 2008 - 13:20:10 GMT