Bug 375881 - allow declare annotation constructs in aop.xml
Summary: allow declare annotation constructs in aop.xml
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.7.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 17:14 EDT by Andrew Clement CLA
Modified: 2013-06-24 11:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2012-04-02 17:14:45 EDT
Spin off of Bug 359159 - this bug is to cover supporting declare annotation in aop.xml
Comment 1 Andrew Clement CLA 2012-04-02 17:19:00 EDT
implemented declare annotation for method/field:

<concrete-aspect name="ConjuredUp">
      <declare-annotation method="* Hello.sayHello(..)" annotation="@Anno"/>
</concrete-aspect>

<concrete-aspect name="ConjuredUp">
      <declare-annotation field="int i" annotation="@Anno(35)"/>
</concrete-aspect>


<concrete-aspect name="ConjuredUp">
      <declare-annotation field="int i" annotation="@Anno(something=false)"/>
</concrete-aspect>

Notice named values are supported for annotation values.  

All annotation value types are supported *except* arrays or annotations.

declare annotation targeting a type is also not supported at the moment.

Note: in order that double quotes don't require writing as &quot; in the XML, it is OK to use single quotes for string values:

      <declare-annotation field="int i" annotation="@Anno(message='hello world')"/>
Comment 2 Dominik Mengelt CLA 2012-04-11 04:10:49 EDT
After a few days of testing everything works as expected. Thanks again. Could you make a statement how hard it would be to implement declaring annotations targeting a type (like annotate a class). In our use case marker annotations for classes/types would be enough.
Comment 3 Andrew Clement CLA 2012-04-11 16:20:38 EDT
targetting a type would be trivial as the infrastructure is all there now.  let me try to fit it into 1.7.

thanks a lot for the feedback on the feature.
Comment 4 Dominik Mengelt CLA 2012-04-11 16:48:25 EDT
so is there a chance to see another dev build with this feature before 1.7? that would be nice! of course we would test this feature and provide an appropriate feedback.
Comment 5 Andrew Clement CLA 2012-04-11 20:42:16 EDT
dev build now available here: http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/dev/aspectj-DEVELOPMENT-20120411173900.jar

this supports:

<declare-annotation type="Foo*" annotation="@Anno"/>

I only added one regression test for it, so any extra testing you could do would be great.
Comment 6 Andrew Clement CLA 2013-06-24 11:06:55 EDT
unsetting the target field which is currently set for something already released