Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Use of non-statically resolvable pointcut designators in declare error/warning.


Hi,

I'm looking at a bug on this - and I noticed someone else mailed
the list on a similar topic earlier today.

Eric Bodden reported a problem with using if() in a declare
warning/error message.  This was a ClassCastException - which of
course I'll fix - but it made me think more about what our
position is on allowing users to use pointcuts that can't
be wholely resolved at compile time with the declare error/warning
mechanism.

At the moment, if a pointcut cannot be entirely statically
evaluated then it will behave as if it has matched and the error
or warning message will be produced.  I don't think this is
quite what we want.

However, it is not clear whether we should be flagging an
error if any of the designators that exhibit this behavior
are used against declare error/warning or if we should be
flagging an error/warning if it just the case that the entire
pointcut cannot be completely resolved statically.  There are
some designators that *could* lead to runtime tests but might
not if there is enough static info around.  For example
target()/this() may or may not create an instanceof test for
execution at runtime depending on what the compiler can
determine statically.

So, we have the options:

Error/Warning if we see a declare error/warning statement whose
pointcut uses any of the designators that *might*
lead to dynamic residue.

Error/Warning if we see a declare error/warning statement whose
pointcut cannot be completely statically evaluated.

Any comments?
Andy.
---
Andy Clement
AJDT/AspectJ Development

Back to the top