mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 02:10:40 +02:00
41 lines
700 B
Java
41 lines
700 B
Java
import org.aspectj.testing.Tester;
|
|
|
|
public class PrivateIntro {
|
|
public static void test() {
|
|
Tester.checkEqual(new A1().getWhere(), "A1", "from A1");
|
|
Tester.checkEqual(new A2().getWhere(), "A2", "from A2");
|
|
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
test();
|
|
}
|
|
}
|
|
|
|
|
|
class A1 {
|
|
private introduction Foo {
|
|
String fromWhere() {
|
|
return "A1";
|
|
}
|
|
}
|
|
|
|
public String getWhere() {
|
|
return new Foo().fromWhere();
|
|
}
|
|
}
|
|
|
|
class A2 {
|
|
private introduction Foo {
|
|
String fromWhere() {
|
|
return "A2";
|
|
}
|
|
}
|
|
|
|
public String getWhere() {
|
|
return new Foo().fromWhere();
|
|
}
|
|
}
|
|
|
|
class Foo {}
|