aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs198
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs198')
-rw-r--r--tests/bugs198/github_105/Application.java18
-rw-r--r--tests/bugs198/github_105/BarAnnotation.java11
-rw-r--r--tests/bugs198/github_105/FooAnnotation.java8
-rw-r--r--tests/bugs198/github_105/FooAspect.aj4
4 files changed, 41 insertions, 0 deletions
diff --git a/tests/bugs198/github_105/Application.java b/tests/bugs198/github_105/Application.java
new file mode 100644
index 000000000..bcf4f5624
--- /dev/null
+++ b/tests/bugs198/github_105/Application.java
@@ -0,0 +1,18 @@
+import java.lang.annotation.Annotation;
+
+/**
+ * {@code FooAspect} should add {@code @BarAnnotation(name = "from FooAspect")}.
+ * <p>
+ * This fails in AspectJ 1.9.5 to 1.9.8.RC2 due to a removed safeguard in JDT Core,
+ * if the aspect is in a separate library on the aspectpath.
+ * <p>
+ * See https://github.com/eclipse/org.aspectj/issues/105
+ */
+@FooAnnotation
+public class Application {
+ public static void main(String[] args) {
+ for (Annotation annotation : Application.class.getDeclaredAnnotations()) {
+ System.out.println(annotation);
+ }
+ }
+}
diff --git a/tests/bugs198/github_105/BarAnnotation.java b/tests/bugs198/github_105/BarAnnotation.java
new file mode 100644
index 000000000..eaee4af2a
--- /dev/null
+++ b/tests/bugs198/github_105/BarAnnotation.java
@@ -0,0 +1,11 @@
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface BarAnnotation {
+ // Note: no default value
+ String name();
+}
diff --git a/tests/bugs198/github_105/FooAnnotation.java b/tests/bugs198/github_105/FooAnnotation.java
new file mode 100644
index 000000000..17e79deb4
--- /dev/null
+++ b/tests/bugs198/github_105/FooAnnotation.java
@@ -0,0 +1,8 @@
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface FooAnnotation {}
diff --git a/tests/bugs198/github_105/FooAspect.aj b/tests/bugs198/github_105/FooAspect.aj
new file mode 100644
index 000000000..0d8e10d9b
--- /dev/null
+++ b/tests/bugs198/github_105/FooAspect.aj
@@ -0,0 +1,4 @@
+public aspect FooAspect {
+ declare @type:(@FooAnnotation *) :
+ @BarAnnotation(name = "from FooAspect");
+}