Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] One target for intertype declarations

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Pearce wrote:
> Hi Matthew,
> 
> Thanks for this reply - it's answered my question and things are
> pretty much as I expected.  One thing, though, is that I don't see
> how only one field could be added per object to implement
> pertarget.    
> 
> In fact, I decompiled an example and as far as I can tell there is
> one field introduced per class, meaning that classes composed using
> inheritance contain multiple instances of the field.  I've attached
> a test case.  Is this right?   

No, I guess that's a misinterpretation: The "bind" method creates a
new aspect instance for every argument object for which it does not
find yet a cached version:

    public static void ajc$perObjectBind(java.lang.Object r0)
    {
        if (r0 instanceof taspect$ajcMightHaveAspect != false)
        {
            if (((taspect$ajcMightHaveAspect)
r0).ajc$taspect$perObjectGet() == null)
            {
/*HERE*/           ((taspect$ajcMightHaveAspect)
r0).ajc$taspect$perObjectSet(new taspect());
            }
        }

        return;
    }

Eric

- -- 
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQaHvzMwiFCm7RlWCEQLJgwCeLWqsPBUkNPOC1vwXaNyB4XsgogQAoNHs
yF/rPEJy68gKQjyD9A9KAGWl
=HozS
-----END PGP SIGNATURE-----




Back to the top