diff options
author | jhugunin <jhugunin> | 2003-07-23 00:22:50 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-07-23 00:22:50 +0000 |
commit | 54a8e9ae3854be8bc202eb55fd1c4e0f735bd424 (patch) | |
tree | a577c46df120003c20d6285a4d0b366371361160 /tests/bugs | |
parent | 9894a3d4826ef3480a53aa7cd8d86804af3f1fdd (diff) | |
download | aspectj-54a8e9ae3854be8bc202eb55fd1c4e0f735bd424.tar.gz aspectj-54a8e9ae3854be8bc202eb55fd1c4e0f735bd424.zip |
added test for expanded version of Bugzilla Bug 39711
Class Literals as non final fields
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/ClassLiteralField.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/bugs/ClassLiteralField.java b/tests/bugs/ClassLiteralField.java new file mode 100644 index 000000000..13539479f --- /dev/null +++ b/tests/bugs/ClassLiteralField.java @@ -0,0 +1,26 @@ +import org.aspectj.testing.Tester; + +public class ClassLiteralField { // synthetic class$n set + public static void main(String[] args) { + Class c = ClassLiteralField.class; // synthetic class$n get + assert c != null; //synthetic $assert + new ClassLiteralField().doInner(); + } + int x=10; + void doInner() { + new Runnable() { // synthetic this$n + public void run() { + x+=1; // synthetic this$n + } + }.run(); + } +} + +aspect A { +// before(): within(ClassLiteralField) && get(* *) && !get(* x) { +// System.out.println("get: " + thisJoinPoint +", " + thisJoinPoint.getSourceLocation()); +// } + + declare error: within(ClassLiteralField) && get(* *) && !get(* x): "unexpected get"; + declare error: within(ClassLiteralField) && set(* *) && !set(* x): "unexpected set"; +}
\ No newline at end of file |