aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features153/ptw/CaseFour.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features153/ptw/CaseFour.java')
-rw-r--r--tests/features153/ptw/CaseFour.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/features153/ptw/CaseFour.java b/tests/features153/ptw/CaseFour.java
new file mode 100644
index 000000000..735bbd4e0
--- /dev/null
+++ b/tests/features153/ptw/CaseFour.java
@@ -0,0 +1,28 @@
+// Types in packages
+
+package a.b;
+
+class AClass {}
+class BClass {}
+class CClass {}
+
+public aspect CaseFour pertypewithin(*Class) {
+ public static void main(String []argv) {
+ new Runner().run();
+ }
+}
+
+class Runner {
+ public void run() {
+ CaseFour aInstance = (CaseFour.hasAspect(AClass.class)?CaseFour.aspectOf(AClass.class):null);
+ CaseFour bInstance = (CaseFour.hasAspect(BClass.class)?CaseFour.aspectOf(BClass.class):null);
+ CaseFour cInstance = (CaseFour.hasAspect(CClass.class)?CaseFour.aspectOf(CClass.class):null);
+
+ System.out.println("BClass aspect instance gives a within type name of "+
+ (bInstance==null?"<null>":bInstance.getWithinTypeName()));
+ System.out.println("CClass aspect instance gives a within type name of "+
+ (cInstance==null?"<null>":cInstance.getWithinTypeName()));
+ System.out.println("AClass aspect instance gives a within type name of "+
+ (aInstance==null?"<null>":aInstance.getWithinTypeName()));
+ }
+}