diff options
author | aclement <aclement> | 2011-10-03 22:40:58 +0000 |
---|---|---|
committer | aclement <aclement> | 2011-10-03 22:40:58 +0000 |
commit | 04de50018188c4602ea3af5298715544f6f0faa1 (patch) | |
tree | b832075c323b04e3909b9901904b1980a76a68af | |
parent | 14a6eac32a20c81682e9b6875e8c3a4a8d9e8897 (diff) | |
download | aspectj-04de50018188c4602ea3af5298715544f6f0faa1.tar.gz aspectj-04de50018188c4602ea3af5298715544f6f0faa1.zip |
327141
-rw-r--r-- | tests/bugs1612/pr327141/AspectWithConstant.aj | 17 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml | 9 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/bugs1612/pr327141/AspectWithConstant.aj b/tests/bugs1612/pr327141/AspectWithConstant.aj new file mode 100644 index 000000000..1dea5b8f4 --- /dev/null +++ b/tests/bugs1612/pr327141/AspectWithConstant.aj @@ -0,0 +1,17 @@ +import java.lang.annotation.*; + +public aspect AspectWithConstant { + declare @field : * AspectWithConstant.MAX* : @Loggable; + public static final int MAX = 9; + public static final float MAXf = 9.0f; + public static final double MAXd = 9.0d; + public static final long MAXl = 9L; + public static final Class MAXc = String.class; + @Retention(RetentionPolicy.RUNTIME) + @interface Loggable { } + + public static void main(String []argv) throws Exception { + System.out.println("MAX="+MAX); +System.out.println(AspectWithConstant.class.getDeclaredField("MAX").getAnnotation(Loggable.class)); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java index 5b04210f0..eb5c5b36b 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc1612/Ajc1612Tests.java @@ -36,6 +36,10 @@ public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // runTest("itd split compilation"); // } + public void testClassCast_327141() { + runTest("classcast"); + } + public void testXmlDefs() { runTest("xml defined advice"); } diff --git a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml index fd57e555d..c02a99886 100644 --- a/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml +++ b/tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml @@ -2,6 +2,15 @@ <suite> + <ajc-test dir="bugs1612/pr327141" title="classcast"> + <compile files="AspectWithConstant.aj" options="-1.5"/> + <run class="AspectWithConstant"> + <stdout> + <line text="MAX=9"/> + <line text="@AspectWithConstant$Loggable()"/> + </stdout></run> + </ajc-test> + <ajc-test dir="bugs1612/xmldefs" title="xml defined advice"> <compile files="Hello.java JavaHelper.java"/> <run class="Hello" ltw="aop.xml"> |