Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Cflow context exposure and hard references

Hi.

I have a quick question about context exposed by cflow pointcuts.

Take e.g. the following definition:

pointcut pc(B b): call(* A.foo()) && cflow(execution(* B.bar()) &&
target(b));

Here pc exposes b from the control flow. This means that internally b must
push a reference to b on the cflow stack. My question is: I this a hard
reference or not?

In the case that it is hard, this means that b is not being garbage
collected. This means there can be chances that it usually *were* garbage
collected but now it is not, because the stack is still referencing the
object. This again means that the advice could access an object which is
actually dead in all other aspects (including the core concern).

In the case that it is weak/soft this means that it is not prevented from
being garbage collected, however this could mean that at the moment you want
to execute, an advie attached to pc, it could be the case that b is gone
(which should maybe prevent the advice from being executed in the first
place).

So what are the current semantics?

Cheers,
Eric

--
Eric Bodden
RWTH Aachen University
ICQ UIN: 12656220, Skype: ericbodden, PGP: BB465582
Website: http://www.bodden.de




Back to the top