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-170.html 3.6KB

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