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.7.0.adoc 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. = AspectJ 1.7.0
  2. _© Copyright 2011 Contributors. All rights reserved._
  3. The full list of resolved issues in 1.7.0 is available
  4. https://bugs.eclipse.org/bugs/buglist.cgi?query_format=advanced;bug_status=RESOLVED;bug_status=VERIFIED;bug_status=CLOSED;product=AspectJ;target_milestone=1.7.0;[here]
  5. _Release info:_
  6. * _1.7.0 available 2-Jul-2012_
  7. * _1.7.0.RC1 available 25-May-2012_
  8. * _1.7.0.M1 available 16-Dec-2011_
  9. == Notable Changes
  10. === Java 7 bytecode weaving
  11. The first milestone of 1.7.0 upgraded the compiler but this still left
  12. the weaver with some issues if it had to weave into bytecode containing
  13. some of the new features that were allowed by Java 1.7. In particular
  14. this meant any bytecode containing the INVOKEDYNAMIC (new instruction
  15. for 1.7) and the related new constant pool entry types that support it.
  16. RC1 now supports weaving into bytecode containing these features.
  17. However, the new INVOKEDYNAMIC instruction does not surface as a join
  18. point yet so you cannot write a pointcut to match on it. If you use
  19. execution() pointcuts as opposed to call() then you will still be able
  20. to advise what the invokedynamic actually calls.
  21. === Bytecode caching for loadtime weaving
  22. Under https://bugs.eclipse.org/bugs/show_bug.cgi?id=367673[bug 367673]
  23. we have had a contribution (thanks John Kew!) that enables a bytecode
  24. cache for loadtime weaving. The details and some rudimentary benchmark
  25. numbers are in the bug. Basically it caches woven bytecode on first
  26. start of a system using LTW and then reuses that woven bytecode on
  27. subsequent starts - this saves weaving time and also memory consumption.
  28. To activate it, use the following system properties:
  29. [source, text]
  30. ....
  31. -Daj.weaving.cache.enabled=true
  32. -Daj.weaving.cache.dir=/tmp/aspectj-cache/
  33. ....
  34. === Upgrade to Java 7
  35. For AspectJ 1.7.0, AspectJ moved from Eclipse JDT Core 0.785_R33x
  36. (Eclipse 3.3) to Eclipse JDT Core 0.B79_R37x (Eclipse 3.7). This is a
  37. big change where AspectJ is picking up four years of change from the
  38. Eclipse compiler.
  39. It means that you can now use the new Java 7 language constructs in your
  40. programs:
  41. - Diamond operator in advice:
  42. [source, java]
  43. ....
  44. aspect Foo {
  45. before(): execution(* *(..)) {
  46. List ls = new ArrayList<>();
  47. }
  48. }
  49. ....
  50. - Diamond operator in ITD:
  51. [source, java]
  52. ....
  53. public List DiamondITD.ls = new ArrayList<>();
  54. ....
  55. - Underscore literals and binary literals in advice:
  56. [source, java]
  57. ....
  58. before(): execution(* *(..)) {
  59. int onemill = 1_000_000;
  60. int four =0b100;
  61. }
  62. ....
  63. - Multi-catch:``
  64. [source, java]
  65. ....
  66. before(): execution(* main(..)) {
  67. try {
  68. foo("abc");
  69. } catch (ExceptionA | ExceptionB ex) {
  70. bar(ex);
  71. }
  72. }
  73. ....
  74. - String switch:``
  75. [source, java]
  76. ....
  77. before(String s): execution(* *(..)) && args(s) {
  78. switch(s) {
  79. case "quux":
  80. foo();
  81. break;
  82. case "bar":
  83. foo();
  84. break;
  85. default:
  86. foo();
  87. break;
  88. }
  89. }
  90. ....
  91. - Try with resources:``
  92. [source, java]
  93. ....
  94. try (
  95. InputStream in = new FileInputStream(src);
  96. OutputStream out = new FileOutputStream(dest))
  97. {
  98. // code
  99. }
  100. ....