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-1.6.0.adoc 5.1KB

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