<maven.javadoc.skip>true</maven.javadoc.skip>
<!-- Dependency versions -->
- <jdt.core.version>1.9.8.RC2</jdt.core.version>
+ <jdt.core.version>1.9.8.RC3</jdt.core.version>
<asm.version>9.2</asm.version>
<lib.ant.version>1.6.3</lib.ant.version>
<lib.ant.xerces.version>2.6.2</lib.ant.xerces.version>
--- /dev/null
+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);
+ }
+ }
+}
--- /dev/null
+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();
+}
--- /dev/null
+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 {}
--- /dev/null
+public aspect FooAspect {
+ declare @type:(@FooAnnotation *) :
+ @BarAnnotation(name = "from FooAspect");
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2021 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc198;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+/**
+ * @author Alexander Kriegisch
+ */
+public class Bugs198Tests extends XMLBasedAjcTestCase {
+
+ public void testGitHub_105() {
+ runTest("ITD annotation with mandatory parameter via aspectpath");
+ }
+
+ @Override
+ protected java.net.URL getSpecFile() {
+ return getClassResource("ajc198.xml");
+ }
+
+}
<suite>
+ <!-- https://github.com/eclipse/org.aspectj/issues/105 -->
+ <ajc-test dir="bugs198/github_105" vm="8" title="ITD annotation with mandatory parameter via aspectpath">
+ <compile files="FooAnnotation.java BarAnnotation.java FooAspect.aj" options="-8" outjar="aspect.jar"/>
+ <compile files="Application.java" options="-8" aspectpath="aspect.jar"/>
+ </ajc-test>
+
<!-- Java 17 final, Java 16, 15 preview -->
<ajc-test dir="features197/java15" vm="17" title="sealed class with legal subclasses">
<compile files="Person.java Employee.java Manager.java" options="-17" />