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-160.html 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html> <head>
  3. <title>AspectJ 6 Development Kit v1.6.0 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 2008 Contributors.
  17. All rights reserved.
  18. </small></div>
  19. <h1>AspectJ v1.6.0 Readme</h1>
  20. <h3>AspectJ v1.6.0 - 23 Apr 2008</h3>
  21. <p>For the complete list of every issue addressed since the last full release, see
  22. <a href="https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=AspectJ&target_milestone=1.6.0+M1&target_milestone=1.6.0+M2&target_milestone=1.6.0+RC1&target_milestone=1.6.0&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">this bugzilla link</a>.
  23. <p>Some of the highlights of 1.6.0 are:
  24. <h4>Upgrade to a Java 1.6 compiler</h4>
  25. <p>AspectJ1.6.0 upgrades the internal Eclipse compiler level to version 785_R33x - a Java 1.6 level compiler</p>
  26. <h4>Better incremental compilation support in the IDE</h4>
  27. <p>Changes under <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=221427">bug 221427</a> mean that the compiler
  28. is better able to maintain incremental state for projects in Eclipse and determine whether full builds or incremental
  29. builds are required when project dependencies change. The result is that the compiler will more frequently do
  30. an incremental build rather than falling back to doing a full build. Some basic performance findings can be seen in
  31. <a href="http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg09002.html">this mailing list post</a>.
  32. <h4>Parameter annotation matching</h4>
  33. <p>Parameter matching is possible for constructors and methods. The use
  34. of parentheses around the parameter types in a method signature
  35. determine whether the annotations relate to the type of the parameter
  36. or the parameter itself.
  37. <pre><code>
  38. execution(* *(@A *));
  39. </code></pre>
  40. <p>- Execution of a method/ctor whose first parameter is of a type
  41. annotated with @A.
  42. <pre><code>
  43. execution(* *(@A (*)));
  44. </code></pre>
  45. <p>- Execution of a method/ctor whose first parameter is annotated with @A
  46. <pre><code>
  47. execution(* *(@A (@B *)))
  48. </code></pre>
  49. <p>- Execution of a method/ctor whose first parameter is annotated with
  50. @A and is of a type annotated with @B.
  51. Example:
  52. <pre><code>
  53. ------ Start of Test.java -----
  54. @interface A {}
  55. @interface B {}
  56. class C {
  57. public void foo(@A String s) {}
  58. public void goo(@A @B String s) {}
  59. }
  60. aspect X {
  61. before(): execution(* *(@A (*))) {}
  62. before(): execution(* *(@B (*))) {}
  63. }
  64. ------ End of Test.java -----
  65. $ ajc -showWeaveInfo -1.6 Test.java
  66. Join point 'method-execution(void C.foo(java.lang.String))' in Type 'C' (A.java:5) advised by before advice from 'X' (A.java:10)
  67. Join point 'method-execution(void C.goo(java.lang.String))' in Type 'C' (A.java:6) advised by before advice from 'X' (A.java:11)
  68. Join point 'method-execution(void C.goo(java.lang.String))' in Type 'C' (A.java:6) advised by before advice from 'X' (A.java:10)
  69. </code></pre>
  70. <p>The first piece of advice matched both methods. The second only matched goo().
  71. <br><br>
  72. <h4>Annotation Value Matching</h4>
  73. <p>This allows static matching of the values of an annotation - if the matching is done statically at weave time, it is possible
  74. to avoid some of the reflection that is currently required within the advice (in some cases). A typical use case is tracing where
  75. the trace level is defined by an annotation but may be switched OFF for a method if the annotation has a particular value. Perhaps
  76. tracing has been turned on at the type level and a few critical methods should not get traced. Here is some code showing the
  77. use case:
  78. <p>
  79. <pre><code>
  80. enum TraceLevel { NONE, LEVEL1, LEVEL2, LEVEL3 }
  81. @interface Trace {
  82. TraceLevel value() default TraceLevel.LEVEL1;
  83. }
  84. aspect X {
  85. // Advise all methods marked @Trace except those with a tracelevel of none
  86. before(): execution(@Trace !@Trace(TraceLevel.NONE) * *(..)) {
  87. System.err.println("tracing "+thisJoinPoint);
  88. }
  89. }
  90. public class ExampleOne {
  91. public static void main(String[] args) {
  92. ExampleOne eOne = new ExampleOne();
  93. eOne.m001();
  94. eOne.m002();
  95. eOne.m003();
  96. eOne.m004();
  97. eOne.m005();
  98. eOne.m006();
  99. eOne.m007();
  100. }
  101. @Trace(TraceLevel.NONE)
  102. public void m001() {}
  103. @Trace(TraceLevel.LEVEL2)
  104. public void m002() {} // gets advised
  105. @Trace(TraceLevel.LEVEL3)
  106. public void m003() {} // gets advised
  107. @Trace(TraceLevel.NONE)
  108. public void m004() {}
  109. @Trace(TraceLevel.LEVEL2)
  110. public void m005() {} // gets advised
  111. @Trace(TraceLevel.NONE)
  112. public void m006() {}
  113. @Trace
  114. public void m007() {} // gets advised
  115. }
  116. </pre></code>
  117. <p>Matching is currently allowed on all annotation value types *except* class and array. Also it is
  118. not currently supported for parameter annotation values.
  119. <h4>Changes since release candidate</h4>
  120. <p>The only fix 1.6.0 final includes beyond the release candidate is a multi-threading problem in the weaver - <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=227029">bug 227029</a>.
  121. <h4>Releases leading up to AspectJ 1.6.0
  122. <p>AspectJ v1.6.0rc1- 16 Apr 2008</p>
  123. <p>AspectJ v1.6.0M2 - 26 Feb 2008</p>
  124. <p>AspectJ v1.6.0M1 - 16 Jan 2008</p>
  125. <hr>
  126. </body>
  127. </html>