mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-07 03:06:19 +02:00
8312dfbc60
moved passing tests from ajcTestsFailing to ajcTests
27 lines
636 B
Java
27 lines
636 B
Java
|
|
import java.util.Observable;
|
|
|
|
|
|
/** @testcase PR#906 privileged access out of code the compiler controls */
|
|
public class PrivilegeBeyondScope {
|
|
|
|
public static void main (String[] args) {
|
|
new C().get();
|
|
throw new Error("expected compiler error");
|
|
}
|
|
}
|
|
|
|
class C {
|
|
Object get() {return null;}
|
|
}
|
|
|
|
privileged aspect A {
|
|
Observable observable = new Observable();
|
|
|
|
after() returning (Object o ) :
|
|
execution(Object C.get()) {
|
|
observable.setChanged(); // CE 22 (unable to implement privilege outside C
|
|
// CE unable to implement privilege outside code the compiler controls
|
|
}
|
|
}
|