mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-07-26 06:44:45 +02:00
26 lines
790 B
Java
26 lines
790 B
Java
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";
|
|
} |