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.9.6.adoc 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. = AspectJ 1.9.6
  2. _© Copyright 2020 Contributors. All rights reserved._
  3. The full list of resolved issues in 1.9.6 is available
  4. https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&f0=OP&f1=OP&f3=CP&f4=CP&j1=OR&list_id=16866879&product=AspectJ&query_format=advanced&target_milestone=1.9.6[here]
  5. _Release info: 1.9.6 available 22-Jul-2020_
  6. AspectJ 1.9.6 supports Java14. Java14 introduces records, but you must
  7. activate support for that via an `--enable-preview` flag when using the
  8. compiler and attempting to run the resultant classes: Here is `Code.java`:
  9. [source, java]
  10. ....
  11. public record Person(String firstName, String lastName, int age) {}
  12. public class UsingPersonRecord {
  13. public static void main(String[] argv) {
  14. Person p = new Person("A","B",99);
  15. System.out.println(p);
  16. System.out.println(p.firstName());
  17. }
  18. }
  19. public aspect TraceRecordComponents {
  20. before(): execution(public * *()) {
  21. System.out.println(thisJoinPointStaticPart);
  22. }
  23. }
  24. ....
  25. Compile it with:
  26. [source, text]
  27. ....
  28. $ ajc --enable-preview -14 Person.java UsingPersonRecord.java TraceRecordComponents.java
  29. ....
  30. Now run it:
  31. [source, text]
  32. ....
  33. $ java --enable-preview UsingPersonRecord
  34. execution(String Person.toString())
  35. Person[firstName=A, lastName=B, age=99]
  36. execution(String Person.firstName())
  37. A
  38. ....