aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs151
diff options
context:
space:
mode:
authoracolyer <acolyer>2006-03-08 10:59:06 +0000
committeracolyer <acolyer>2006-03-08 10:59:06 +0000
commit103733b9c277f980d30db27710ea359974e45c81 (patch)
tree96963a89820ee4e05c27f286021b19c2b35407cb /tests/bugs151
parent0370f564e76e1dc2338b22d1be266dc9edc8cdd1 (diff)
downloadaspectj-103733b9c277f980d30db27710ea359974e45c81.tar.gz
aspectj-103733b9c277f980d30db27710ea359974e45c81.zip
Progress on: Bug 130869: Pointcut resolution fails against type variables
https://bugs.eclipse.org/bugs/show_bug.cgi?id=130869 fix and test case...
Diffstat (limited to 'tests/bugs151')
-rw-r--r--tests/bugs151/GenericAspectWithAnnotationTypeParameter.aj35
-rw-r--r--tests/bugs151/pr130869.aj42
2 files changed, 77 insertions, 0 deletions
diff --git a/tests/bugs151/GenericAspectWithAnnotationTypeParameter.aj b/tests/bugs151/GenericAspectWithAnnotationTypeParameter.aj
new file mode 100644
index 000000000..e4cc3f1be
--- /dev/null
+++ b/tests/bugs151/GenericAspectWithAnnotationTypeParameter.aj
@@ -0,0 +1,35 @@
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+public class GenericAspectWithAnnotationTypeParameter {
+
+ @AnnOne
+ @AnnTwo
+ public static void main(String[] args) {
+ System.out.println("hello");
+ }
+
+
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface AnnOne {}
+@interface AnnTwo {}
+
+abstract aspect AnnotationMatcher<A extends Annotation> {
+
+ before() : execution(* *(..)) && @annotation(A) {
+ System.out.println("annotation match - no binding");
+ }
+
+ before() : execution(@A * *(..)) {
+ System.out.println("execution with annotation match");
+ }
+
+ before(A anAnnotation) : execution(* *(..)) && @annotation(anAnnotation) {
+ System.out.println("annotation match - binding");
+ }
+}
+
+aspect AnnOneMatcher extends AnnotationMatcher<AnnOne> {} \ No newline at end of file
diff --git a/tests/bugs151/pr130869.aj b/tests/bugs151/pr130869.aj
new file mode 100644
index 000000000..c46e21640
--- /dev/null
+++ b/tests/bugs151/pr130869.aj
@@ -0,0 +1,42 @@
+abstract aspect AbstractSystemArchitecture {
+
+ public abstract pointcut inMyApplication();
+
+ // more pointcuts below...
+
+}
+
+aspect MySystemArchitecture extends AbstractSystemArchitecture {
+
+ public pointcut inMyApplication() : within(SomeClass);
+
+}
+
+abstract aspect NoDirectlyRunnableClasses<A extends AbstractSystemArchitecture> {
+
+ declare warning : execution(public static void main(String[])) &&
+ A.inMyApplication()
+ : "no directly runnable classes";
+
+}
+
+aspect NoRunnablesInMyApp extends NoDirectlyRunnableClasses<MySystemArchitecture> {
+
+}
+
+
+class SomeClass {
+
+ public static void main(String[] args) { // CW L30
+ System.out.println("hello");
+ }
+
+}
+
+class SomeOtherClass {
+
+ public static void main(String[] args) { // no warning
+ System.out.println("hello");
+ }
+
+} \ No newline at end of file