diff options
author | Andrew Clement <aclement@vmware.com> | 2025-04-15 15:26:29 -0700 |
---|---|---|
committer | Andrew Clement <aclement@vmware.com> | 2025-04-15 15:26:29 -0700 |
commit | 2b0e11d8633c84e8b0827e0eb77b4639fe0914e4 (patch) | |
tree | 1a7973c688df646a7d7d6db43d5f7d95c63f3feb /tests/bugs1924 | |
parent | e0d2b60288f20d00071cf5e0134a31b5758bb006 (diff) | |
download | aspectj-master.tar.gz aspectj-master.zip |
This change fixes more cases in the *Declaration classes that generate code.
Both #336 and #337 are due to the same piece of code not correctly computing
the resolved position because of copying it from a source method when it needs
recomputing for the method being generated. In particular primitive types
and/or double slot types (like long or double) cause the code to miscompute
the resolved positions or set the wrong type of expected type on the stack.
Fixes #336
Fixes #337
Diffstat (limited to 'tests/bugs1924')
-rw-r--r-- | tests/bugs1924/336/Bang.java | 17 | ||||
-rw-r--r-- | tests/bugs1924/337/X.aj | 12 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/bugs1924/336/Bang.java b/tests/bugs1924/336/Bang.java new file mode 100644 index 000000000..276484c51 --- /dev/null +++ b/tests/bugs1924/336/Bang.java @@ -0,0 +1,17 @@ +public class Bang { + +public static void main(String[] argv) { + new Bang().m("a",1,"b"); +} + + public int m(String a, int i, String b) { + return 42; + } + +} + +aspect X { + int around(String a, int b, String d): execution(* m(..)) && args(a,b,d) { + return proceed(a,b,d); + } +} diff --git a/tests/bugs1924/337/X.aj b/tests/bugs1924/337/X.aj new file mode 100644 index 000000000..922a6ab67 --- /dev/null +++ b/tests/bugs1924/337/X.aj @@ -0,0 +1,12 @@ +public aspect X {
+ pointcut p(long l): call(* F.m(..)) && args(l);
+ Object around (long id): p(id) { return null; }
+
+ public static void main(String []argv) {
+ new F().m(3L);
+ }
+}
+
+class F {
+ public void m(long r) {}
+}
|