From 36c91148128afe51181cea40c70866e6e21dd64e Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 10 Aug 2010 23:48:19 +0000 Subject: 322272: declare annotation for incremental compilation when used through abstract aspect. --- tests/bugs1610/pr322272/Base.java | 9 +++++++++ tests/bugs1610/pr322272/Base2.java | 9 +++++++++ tests/bugs1610/pr322272/F1.java | 8 ++++++++ tests/bugs1610/pr322272/F2.java | 8 ++++++++ .../aspectj/systemtest/ajc1610/Ajc1610Tests.java | 11 +++++++++-- .../src/org/aspectj/systemtest/ajc1610/ajc1610.xml | 22 ++++++++++++++++++++++ 6 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 tests/bugs1610/pr322272/Base.java create mode 100644 tests/bugs1610/pr322272/Base2.java create mode 100644 tests/bugs1610/pr322272/F1.java create mode 100644 tests/bugs1610/pr322272/F2.java (limited to 'tests') diff --git a/tests/bugs1610/pr322272/Base.java b/tests/bugs1610/pr322272/Base.java new file mode 100644 index 000000000..035fa9c6b --- /dev/null +++ b/tests/bugs1610/pr322272/Base.java @@ -0,0 +1,9 @@ +import java.lang.annotation.*; + +public abstract aspect Base { + declare @type: F*: @Anno; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { +} diff --git a/tests/bugs1610/pr322272/Base2.java b/tests/bugs1610/pr322272/Base2.java new file mode 100644 index 000000000..08131a6b4 --- /dev/null +++ b/tests/bugs1610/pr322272/Base2.java @@ -0,0 +1,9 @@ +import java.lang.annotation.*; + +public abstract aspect Base2 { + declare @type: F*: @Anno; +} + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { +} diff --git a/tests/bugs1610/pr322272/F1.java b/tests/bugs1610/pr322272/F1.java new file mode 100644 index 000000000..c3df6093b --- /dev/null +++ b/tests/bugs1610/pr322272/F1.java @@ -0,0 +1,8 @@ +public class F1 { + public static void main(String []argv) throws Exception { + System.out.println(F1.class.getAnnotations()[0]); + } +} + +aspect X extends Base { +} diff --git a/tests/bugs1610/pr322272/F2.java b/tests/bugs1610/pr322272/F2.java new file mode 100644 index 000000000..c0df2c9ac --- /dev/null +++ b/tests/bugs1610/pr322272/F2.java @@ -0,0 +1,8 @@ +public class F2 { + public static void main(String []argv) throws Exception { + System.out.println(F2.class.getAnnotations()[0]); + } +} + +aspect X extends Base2 { +} diff --git a/tests/src/org/aspectj/systemtest/ajc1610/Ajc1610Tests.java b/tests/src/org/aspectj/systemtest/ajc1610/Ajc1610Tests.java index 04641aaaf..061be391b 100644 --- a/tests/src/org/aspectj/systemtest/ajc1610/Ajc1610Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1610/Ajc1610Tests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 Contributors + * Copyright (c) 2008 Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,7 +18,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc1610Tests extends org.aspectj.testing.XMLBasedAjcTestCase { - // Interesting new behaviour on AspectJ 1.6.9 - probably due to initial inner type changes. + public void testAbstractAspectAndDeclares_322272_2() { + runTest("abstract aspects and declares - 2"); + } + + public void testAbstractAspectAndDeclares_322272() { + runTest("abstract aspects and declares"); + } + // Interesting new behaviour on AspectJ 1.6.9 - probably due to initial inner type changes. // Looks a real error (creating two annotations the same on a type is a bad thing) // public void testDuplicateAnnotations() { // runTest("duplicate annotation"); diff --git a/tests/src/org/aspectj/systemtest/ajc1610/ajc1610.xml b/tests/src/org/aspectj/systemtest/ajc1610/ajc1610.xml index c51060775..44b7c0eba 100644 --- a/tests/src/org/aspectj/systemtest/ajc1610/ajc1610.xml +++ b/tests/src/org/aspectj/systemtest/ajc1610/ajc1610.xml @@ -12,4 +12,26 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3