diff options
author | jhugunin <jhugunin> | 2003-01-14 19:28:13 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-01-14 19:28:13 +0000 |
commit | 9a532972a6044080b4fed1d1d4a76f803f46fcc6 (patch) | |
tree | 0f8543e01fa22125ead811bc4aaac78ea71fb00d /tests/new | |
parent | f1de2b647b2db6da2dce83d4b0679082e98df784 (diff) | |
download | aspectj-9a532972a6044080b4fed1d1d4a76f803f46fcc6.tar.gz aspectj-9a532972a6044080b4fed1d1d4a76f803f46fcc6.zip |
added test for introduced final fields and rearranged some
Diffstat (limited to 'tests/new')
-rw-r--r-- | tests/new/finalfield/Introducer.java | 5 | ||||
-rw-r--r-- | tests/new/finalfield/Receiver.java | 2 | ||||
-rw-r--r-- | tests/new/finalfield/User1.java | 8 | ||||
-rw-r--r-- | tests/new/finalfield/User2.java | 11 | ||||
-rw-r--r-- | tests/new/finalfield/UserCf.java | 8 |
5 files changed, 34 insertions, 0 deletions
diff --git a/tests/new/finalfield/Introducer.java b/tests/new/finalfield/Introducer.java new file mode 100644 index 000000000..fbd736ead --- /dev/null +++ b/tests/new/finalfield/Introducer.java @@ -0,0 +1,5 @@ +aspect Introducer { + final boolean Receiver.someField = true; + + public static final int Receiver.constant = 2; +} diff --git a/tests/new/finalfield/Receiver.java b/tests/new/finalfield/Receiver.java new file mode 100644 index 000000000..f8c8e2ea0 --- /dev/null +++ b/tests/new/finalfield/Receiver.java @@ -0,0 +1,2 @@ +class Receiver { +} diff --git a/tests/new/finalfield/User1.java b/tests/new/finalfield/User1.java new file mode 100644 index 000000000..ab27a1213 --- /dev/null +++ b/tests/new/finalfield/User1.java @@ -0,0 +1,8 @@ +import org.aspectj.testing.Tester; + +public class User1 { + public static void main(String[] args) { + Receiver r = new Receiver(); + Tester.check(r.someField, "introduced field"); + } +}
\ No newline at end of file diff --git a/tests/new/finalfield/User2.java b/tests/new/finalfield/User2.java new file mode 100644 index 000000000..6210f2a6b --- /dev/null +++ b/tests/new/finalfield/User2.java @@ -0,0 +1,11 @@ +import org.aspectj.testing.Tester; + +public class User2 { + public static void main(String[] args) { + switch(Receiver.constant) { + case 2: + return; + } + Tester.checkFailed("shouldn't get here"); + } +}
\ No newline at end of file diff --git a/tests/new/finalfield/UserCf.java b/tests/new/finalfield/UserCf.java new file mode 100644 index 000000000..20bb77b7a --- /dev/null +++ b/tests/new/finalfield/UserCf.java @@ -0,0 +1,8 @@ +import org.aspectj.testing.Tester; + +public class UserCf { + public static void main(String[] args) { + Receiver r = new Receiver(); + r.someField = false; + } +}
\ No newline at end of file |