Bug 247319 - Introduce marker interface "IsWeavable" for weavable types
Summary: Introduce marker interface "IsWeavable" for weavable types
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 13:35 EDT by Eric Bodden CLA
Modified: 2008-09-15 13:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Bodden CLA 2008-09-15 13:35:04 EDT
I have a use case where I want to identify whether or not a class is weavable:

I am developing a data-race detection tool that tracks information about locks associated with objects using the lock/unlock pointcuts. If the type of the object that I lock is weavable, e.g. because I call a synchronized method of a weavable class then I can associate this information with the locked object using an ITD. If not, then I have to use *slower* hash maps. It would be great if I could have both.

My suggestion is to include a new marker interface "IsWeavable" which the AJ compiler automatically declares on all weavable types. That way I could have something like:

LockInfo IsWeavable.lockInfo; //ITD only for weavable classes

after(IsWeavable o): lock() && args(o) {
  //do stuff with o.lockInfo
}

after(Object o): lock() && args(o) && !args(IsWeavable) {
  //use a map to associate o with some lockInfo
}