diff options
author | Andy Clement <aclement@pivotal.io> | 2021-11-29 15:30:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-29 15:30:39 -0800 |
commit | 90cfa088f5a2c0c8eb2b04553e14c560f472512a (patch) | |
tree | 02452111bbad2df3fd05d990acced7420eb9f84a | |
parent | 8b42ec9980b5a03c3d189156deb4b1212b26b793 (diff) | |
parent | 2544ad77d9ec7751ca298b4a09848487305a27d3 (diff) | |
download | aspectj-90cfa088f5a2c0c8eb2b04553e14c560f472512a.tar.gz aspectj-90cfa088f5a2c0c8eb2b04553e14c560f472512a.zip |
Merge pull request #106 from kriegaex/release-198
Release 1.9.8.RC3, fixing #105
-rw-r--r-- | docs/developer/RELEASE.md | 4 | ||||
-rw-r--r-- | docs/dist/doc/README-198.html | 5 | ||||
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | tests/bugs198/github_105/Application.java | 18 | ||||
-rw-r--r-- | tests/bugs198/github_105/BarAnnotation.java | 11 | ||||
-rw-r--r-- | tests/bugs198/github_105/FooAnnotation.java | 8 | ||||
-rw-r--r-- | tests/bugs198/github_105/FooAspect.aj | 4 | ||||
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java | 1 | ||||
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java | 31 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml | 6 |
10 files changed, 87 insertions, 3 deletions
diff --git a/docs/developer/RELEASE.md b/docs/developer/RELEASE.md index ed06f6932..3d0db25be 100644 --- a/docs/developer/RELEASE.md +++ b/docs/developer/RELEASE.md @@ -121,7 +121,7 @@ Before we release the staging repository though, we want to commit and tag the r git commit -am "Set version to 1.9.8.M2" # Tag release -git tag V1_9_7_M2 +git tag V1_9_8_M2 # Set new snapshot version, increasing the version number after a final release mvn versions:set -DnewVersion=1.9.8-SNAPSHOT @@ -136,7 +136,7 @@ git commit -am "Set version to 1.9.8-SNAPSHOT" git push origin # Push the release tag to GitHub -git push origin V1_9_7_M2 +git push origin V1_9_8_M2 ``` OK, the Git house-keeping is done. Now finally, let us enjoy the fruits of our work and release the staging repository diff --git a/docs/dist/doc/README-198.html b/docs/dist/doc/README-198.html index 24abfdb95..57165e5c0 100644 --- a/docs/dist/doc/README-198.html +++ b/docs/dist/doc/README-198.html @@ -99,6 +99,11 @@ <li>Document build profiles and properties in <i>docs/developer/BUILD.md</i></li> <li>Add a guide for setting up an AspectJ development environment in <i>docs/developer/IDE.md</i></li> <li>Allow JAR saving if <tt>-proceedOnError</tt> is specified</li> + <li> + Fix <a href="https://github.com/eclipse/org.aspectj/issues/105">issue #105</a>: Compilation fails when using an + aspect library via <tt>-aspectpath</tt> in combination with introducing an annotation via ITD. This was broken since + version 1.9.5 and fixed in 1.9.8.RC3. + </li> </ul> <p> @@ -21,7 +21,7 @@ <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> 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"); +} diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java index 69ed09593..4aac84810 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/AllTestsAspectJ198.java @@ -18,6 +18,7 @@ public class AllTestsAspectJ198 { public static Test suite() { TestSuite suite = new TestSuite("AspectJ 1.9.8 tests"); + suite.addTest(Bugs198Tests.suite()); if (LangUtil.is9VMOrGreater()) { suite.addTest(CompileWithReleaseTests.suite()); } diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java new file mode 100644 index 000000000..d8e57b534 --- /dev/null +++ b/tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * 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 junit.framework.Test; +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"); + } + + public static Test suite() { + return XMLBasedAjcTestCase.loadSuite(Bugs198Tests.class); + } + + @Override + protected java.net.URL getSpecFile() { + return getClassResource("ajc198.xml"); + } + +} diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml index c182b58b9..dfe86e2a9 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml @@ -3,6 +3,12 @@ <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" /> |