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 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  2. <html> <head>
  3. <title>AspectJ 1.7.0.M1 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.M1 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. <h4>1.7.0.M1 available 16-Dec-2011</h4>
  23. <h2>Notable Changes</h2>
  24. <h3>M1 - upgrade to Java 7</h3>
  25. <p>
  26. This milestone is the first after the upgrade to the Eclipse Java 7 compiler.
  27. AspectJ moved from Eclipse JDT Core 0.785_R33x (Eclipse 3.3) to Eclipse JDT Core 0.B79_R37x (Eclipse 3.7).
  28. This is a big change where AspectJ is picking up four years of change from the Eclipse compiler.
  29. </p>
  30. <p>
  31. It means that you can now use the new Java 7 language constructs in your programs:</p>
  32. <p>
  33. - Diamond operator in advice:
  34. <code><pre>
  35. aspect Foo {
  36. before(): execution(* *(..)) {
  37. List<String> ls = new ArrayList<>();
  38. }
  39. }
  40. </pre></code>
  41. <p>
  42. - Diamond operator in ITD:
  43. <code><pre>
  44. public List<String> DiamondITD.ls = new ArrayList<>();
  45. </pre></code>
  46. <p>
  47. - Underscore literals and binary literals in advice:
  48. <code><pre>
  49. before(): execution(* *(..)) {
  50. int onemill = 1_000_000;
  51. int four =0b100;
  52. }
  53. </pre></code>
  54. <p>
  55. - Multi-catch:<code><pre>
  56. before(): execution(* main(..)) {
  57. try {
  58. foo("abc");
  59. } catch (ExceptionA | ExceptionB ex) {
  60. bar(ex);
  61. }
  62. }
  63. </pre></code>
  64. <p>
  65. - String switch:<code><pre>
  66. before(String s): execution(* *(..)) && args(s) {
  67. switch(s) {
  68. case "quux":
  69. foo();
  70. break;
  71. case "bar":
  72. foo();
  73. break;
  74. default:
  75. foo();
  76. break;
  77. }
  78. }
  79. </pre></code>
  80. <p>
  81. - Try with resources:<code><pre>
  82. try (
  83. InputStream in = new FileInputStream(src);
  84. OutputStream out = new FileOutputStream(dest))
  85. {
  86. // code
  87. }
  88. </pre></code>
  89. </p>
  90. <p><b>Note:</b> there is still more to be done for full Java7 support. invokedynamic handling is not in place yet (AspectJ may have trouble if it encounters that bytecode instruction). Also interplay between
  91. the new language constructs and the existing pointcuts needs some work - for example handler() pointcut and multicatch has a known issue right now.
  92. <h4>
  93. <!-- ============================== -->
  94. </body>
  95. </html>