aboutsummaryrefslogtreecommitdiffstats
path: root/docs/dist/doc/README-196.html
blob: e85348867ed3f871b4aa1e1ab398ef346cf3fe48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html> <head>
<title>AspectJ 1.9.6 Readme</title>
<style type="text/css">
<!--
  P   { margin-left:  20px; }
  PRE { margin-left:  20px; }
  LI  { margin-left:  20px; }
  H4  { margin-left:  20px; }
  H3  { margin-left:  10px; }
-->
</style>
</head>

<body>
<div align="right"><small>
&copy; Copyright 2020 Contributors.
All rights reserved.
</small></div>
<h1>AspectJ 1.9.6</h1>
<p>The full list of resolved issues in 1.9.6 is available 
<a href="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</a></h2>.</p>

<p>AspectJ 1.9.6 supports Java14. Java14 introduces records, but you must activate support for that via 
an <tt>--enable-preview</tt> flag when using the compiler and attempting to run the resultant classes:

Here is <tt>Code.java</tt>:
<pre><code>
=======8<=========
public record Person(String firstName, String lastName, int age) {}
=======8<=========

=======8<=========
public class UsingPersonRecord {
  public static void main(String[] argv) {
    Person p = new Person("A","B",99);
    System.out.println(p);
    System.out.println(p.firstName());
  }
}
=======8<=========

=======8<=========
public aspect TraceRecordComponents {
  before(): execution(public * *()) {
    System.out.println(thisJoinPointStaticPart);
  }
}
=======8<=========
</code></pre>

<p>Compile it with:
<pre><code>
$ ajc --enable-preview -14 Person.java UsingPersonRecord.java TraceRecordComponents.java
</code></pre>

<p>Now run it:
<pre><code>
$ java --enable-preview UsingPersonRecord
execution(String Person.toString())
Person[firstName=A, lastName=B, age=99]
execution(String Person.firstName())
A
</code></pre>

<p>Available: 1.9.6 available 22-Jul-2020</p>

<br><br>


<!-- ============================== -->  
</body>
</html>