aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features153/ptw/CaseOne.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/features153/ptw/CaseOne.java')
-rw-r--r--tests/features153/ptw/CaseOne.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/features153/ptw/CaseOne.java b/tests/features153/ptw/CaseOne.java
new file mode 100644
index 000000000..ea310ae70
--- /dev/null
+++ b/tests/features153/ptw/CaseOne.java
@@ -0,0 +1,22 @@
+// Types not in packages
+
+class AClass {}
+class BClass {}
+class CClass {}
+
+public aspect CaseOne pertypewithin(*Class) {
+ public static void main(String []argv) {
+ new Runner().run();
+ }
+}
+
+class Runner {
+ public void run() {
+ if (CaseOne.hasAspect(AClass.class)) {
+ System.out.println("AClass has an aspect instance");
+ CaseOne instance = CaseOne.aspectOf(AClass.class);
+ String name = instance.getWithinTypeName();
+ System.out.println("The aspect instance thinks it is for type name "+name);
+ }
+ }
+}