You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README-1612.html 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html> <head>
  3. <title>AspectJ 1.6.12 Readme</title>
  4. <style type="text/css">
  5. <!--
  6. P { margin-left: 20px; }
  7. PRE { margin-left: 20px; }
  8. LI { margin-left: 20px; }
  9. H4 { margin-left: 20px; }
  10. H3 { margin-left: 10px; }
  11. -->
  12. </style>
  13. </head>
  14. <body>
  15. <div align="right"><small>
  16. &copy; Copyright 2010-2011 Contributors.
  17. All rights reserved.
  18. </small></div>
  19. <h1>AspectJ 1.6.12 Readme</h1>
  20. <p>The full list of resolved issues in 1.6.12 is available
  21. <a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.6.12;">here</a></h2>.</p>
  22. <h4>1.6.12.M2 available 18-Aug-2011</h4>
  23. <h4>1.6.12.M1 available 7-Jun-2011</h4>
  24. <h2>Notable Changes</h2>
  25. <hr>
  26. <h3>M2 - thisAspectInstance (<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=239649">bug239649</a>)</h3>
  27. <p>
  28. There is now a new well known name that you can use in the if clauses in your aspects. <tt>thisAspectInstance</tt> provides access to the aspect instance.
  29. Here is an example:
  30. <code><pre>aspect X {
  31. boolean doit() {
  32. System.out.println("In instance check method doit()");
  33. return true;
  34. }
  35. before():execution(* m(..)) && if(thisAspectInstance.doit()){
  36. System.out.println(thisJoinPoint);
  37. }
  38. }</pre></code>
  39. <p>Now why not just use <tt>X.aspectOf()</tt> instead of <tt>thisAspectInstance</tt>? Well <tt>thisAspectInstance</tt> is quite useful
  40. when working with abstract/concrete aspects:
  41. <code><pre>
  42. abstract aspect X {
  43. abstract pointcut p();
  44. boolean doit() {
  45. return true;
  46. }
  47. before():p() && if(thisAspectInstance.doit()){
  48. System.out.println(thisJoinPoint);
  49. }
  50. }
  51. aspect Y extends X {
  52. pointcut p(): execution(* m(..));
  53. }</pre></code>
  54. <p>Now <tt>thisAspectInstance</tt> will be an instance of the Y, not X.
  55. It enables the aspect instance to be used in some kind of check/guard that will avoid the costly creation of a thisJoinPoint object if
  56. the advice isn't going to run.
  57. <b>Note:</b> right now this only works for singleton aspects. If you have need of it with other instantiation models, please comment on
  58. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=239649">https://bugs.eclipse.org/bugs/show_bug.cgi?id=239649</a>
  59. </p>
  60. <h3>M2 - weaving groovy</h3>
  61. <p>
  62. Although we have been successfully weaving groovy for a long time, it is becoming more popular and a few issues have been uncovered
  63. when using non-singleton aspects with groovy code. These have been fixed.
  64. </p>
  65. <h3>M2 - AJDT memory</h3>
  66. <p>
  67. The release notes for the last few versions of AspectJ have mentioned two options (minimalModel and typeDemotion) which can be
  68. switched on to reduce memory consumption. They have had enough field testing now and from 1.6.12.M2 onwards they are on by default.
  69. Users should see a reduction in memory consumed by AspectJ projects in AJDT. It won't affect load time weaving. It may also help
  70. command line (or Ant) compile time weaving. If these options cause a problem then please raise a bugzilla but in the interim you could
  71. work around the problem by actively turning them off by
  72. specifying <tt>-Xset:minimalModel=false,typeDemotion=false</tt> in the project properties for your AspectJ project.
  73. </p>
  74. <h3>M2 - Java7 weaving support</h3>
  75. <p>Some preliminary work has been done to support Java7. Java7 class files must contain the necessary extra verifier support attributes
  76. in order to load successfully on a Java7 VM - the attributes were only optional in Java6. It is possible to force loading of classes missing
  77. the attributes but that requires use of a -XX option. AspectJ 1.6.12.M2 should create these for you if you weave Java7 level class
  78. files. Nothing has been done yet to rebase AspectJ on a version of the Eclipse compiler that supports Java7 language constructs -
  79. that will happen after Eclipse 3.7.1 is out.
  80. </p>
  81. <hr>
  82. <h3>M1 - synthetic is supported in pointcut modifiers <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=327867">327867</a></h3>
  83. <p>It is now possible to specify synthetic in pointcuts:
  84. </p>
  85. <pre><code>pointcut p(): execution(!synthetic * *(..));
  86. </code></pre>
  87. <h3>M1 - respect protection domain when generating types during weaving <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=328099">328099</a></h3>
  88. <p>This enables us to weave signed jars correctly. AspectJ sometimes generates closure classes during weaving and
  89. these must be defined with the same protection domain as the jar that gave rise to them. In 1.6.12.M1 this should
  90. now work correctly.
  91. </p>
  92. <h3>M1 - Suppressions inline with the JDT compiler <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=335810">335810</a></h3>
  93. <p>Starting with Eclipse 3.6, the Eclipse compiler no longer suppresses raw type
  94. warnings with @SuppressWarnings("unchecked"). You need to use
  95. @SuppressWarnings("rawtypes") for that. AspectJ has now been updated with this rule too.
  96. </p>
  97. <h3>M1 - Optimized annotation value binding for ints <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=347684">347684</a></h3>
  98. <p>The optimized annotation value binding now supports ints - this is for use when you want to match upon the existence of an annotation but
  99. you don't need the annotation, you just need a value from it. This code snippet shows an example:</p>
  100. <pre><code>@interface SomeAnnotation {
  101. int i();
  102. }
  103. before(int i): execution(* *(..)) && @annotation(SomeAnnotation(i)) {
  104. </code></pre>
  105. <p>
  106. Binding values in this way will result in code that runs *much* faster than using pointcuts that
  107. bind the annotation itself then pull out the value.
  108. </p>
  109. <p>Under that same bug some changes were made to match values by name when binding too. Suppose the annotation
  110. had multiple int values, how would we select which int to bind? AspectJ will now use the name (if it can) to select
  111. the right value:
  112. <pre><code>@interface SomeAnnotation {
  113. int mods();
  114. int flags();
  115. }
  116. before(int flags): execution(* *(..)) && @annotation(SomeAnnotation(flags)) {
  117. </code></pre>
  118. <p>Here the use of 'flags' as the name of the value being bound will ensure the 'flags' value from any SomeAnnotation is
  119. bound and not the 'mods' value.</p>
  120. <h4>
  121. <!-- ============================== -->
  122. </body>
  123. </html>