[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Intertype declaration name mangling - for or against?
- From: Ramnivas Laddad <ramnivas@xxxxxxxxxxxxxxx>
- Date: Fri, 20 Nov 2009 09:32:18 -0800
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to :content-type; bh=2O4V3JprljOggibF05XRiiNTQdJdUx2Vl6EPizCNiHA=; b=KpFc+HdptRoIfr7uNGxgZ2K6Ul8OjNPdvZz2LX4BhuQvbE5FhivWh22H6EKiY+phHi ei9DWPJ8DXP4OhUo+UF9qOe4hfZ/WavIknf/Gbh7E8HUwcPUQiGEc56Uw7AzM0juJa+I ZRdTjZaV+EjJZaqQlY4n+ygaJJycFNBRAdCaE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=OHHRpntwpLGBmKkzL5N/QCFH0A9bFTzE8sl4fsvTWmUV5eo84evaolkzIVRPLEzehC tdbmfRO/X0pARlNwyOnRYzAktLGyEmik1YooA/1iNxeaqXhrK8L3h3ddRveMpduJ65ro 1T2/9wDFI0CKRZeyHcg0FMDquj695jlfnIGiM=
I am all for this. Mangled names create problems with JPA and such.
I guess one issue to consider is what happens when two aspects want to introduce a same-named field with a directive to not mangle, especially if both aspects are from third-party libraries. This is quite unlikely to occur in practice, but we may need to address it somehow. I wonder if the 'declare precedence' can be an arbitrator here.
On Thu, Nov 19, 2009 at 10:54 AM, Andy Clement <andrew.clement@xxxxxxxxx>
I'm possibly going to review our approach to intertype declaration
naming. The names are currently mangled deliberately to preserve some
of the 'rules' that AspectJ defines. For example, private field itds
have mangled names because the field is private to the aspect and
shouldn't be visible as a 'regular' private field in the target. This
also enables two aspects to ITD the same private field and there is no
clash in the target type.
However, since those rules were defined a long time ago, things have
changed and various frameworks are looking at members via reflection,
for purposes of invocation or automatic persistence. The mangling is
I *thinking* about allowing non-mangled names, possibly with a
directive annotation in the aspect that says "do not mangle these, I
know what I'm doing and there won't be a problem".
Basically I wanted to collect any thoughts from you guys?
I suspect that the some of the scenarios AspectJ worries about rarely
happen in practice - have you ever ITD'd the same named private field
from two aspects onto the same type? (AspectJ can continue to
warn/error when it sees this about to happen of course)
aspectj-users mailing list