Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 22786 Details for
Bug 98901
Must copy annotations to *public* intertype declarations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
tests for the above five cases
tests.txt (text/plain), 8.73 KB, created by
Andrew J Huff
on 2005-06-10 08:07:17 EDT
(
hide
)
Description:
tests for the above five cases
Filename:
MIME Type:
Creator:
Andrew J Huff
Created:
2005-06-10 08:07:17 EDT
Size:
8.73 KB
patch
obsolete
>Index: src/org/aspectj/systemtest/ajc150/AnnotationsBinaryWeaving.java >=================================================================== >RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc150/AnnotationsBinaryWeaving.java,v >retrieving revision 1.2 >diff -u -r1.2 AnnotationsBinaryWeaving.java >--- src/org/aspectj/systemtest/ajc150/AnnotationsBinaryWeaving.java 11 Feb 2005 12:47:56 -0000 1.2 >+++ src/org/aspectj/systemtest/ajc150/AnnotationsBinaryWeaving.java 10 Jun 2005 12:04:58 -0000 >@@ -52,5 +52,25 @@ > public void test004_decpOnAnnotationNotAllowed_xlints() { > runTest("declare parents wildcards matching annotation types"); > } >+ >+ public void test005(){ >+ runTest("public ITD method with no annotation that has declare @method annotation on it"); >+ } >+ >+ public void test006(){ >+ runTest("public ITD field with annotation on it"); >+ } >+ >+ public void test007(){ >+ runTest("public ITD field with no annotation that has declare @field annotation on it"); >+ } >+ >+ public void test008(){ >+ runTest("public ITD method with annotation on it which is made onto an interface"); >+ } >+ >+ public void test009(){ >+ runTest("public abstract ITD method with annotations on it"); >+ } > > } >\ No newline at end of file >Index: src/org/aspectj/systemtest/ajc150/ajc150.xml >=================================================================== >RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml,v >retrieving revision 1.41 >diff -u -r1.41 ajc150.xml >--- src/org/aspectj/systemtest/ajc150/ajc150.xml 9 Jun 2005 13:59:15 -0000 1.41 >+++ src/org/aspectj/systemtest/ajc150/ajc150.xml 10 Jun 2005 12:04:59 -0000 >@@ -2370,4 +2370,58 @@ > <!-- End of generics tests --> > <!-- ============================================================== --> > >+ <ajc-test dir="bugs150/pr98901" title="public ITD method with no annotation that has declare @method annotation on it"> >+ <compile files="Case1.aj" options="-1.5 -Xlint:warning"> >+ <message kind="warning" line="14" text="advice defined in B1 has not been applied [Xlint:adviceDidNotMatch]"/> >+ </compile> >+ <run class="B1"> >+ <stdout> >+ <line text="@anInterface()"/> >+ </stdout> >+ </run> >+ </ajc-test> >+ >+ <ajc-test dir="bugs150/pr98901" title="public ITD field with annotation on it"> >+ <compile files="Case2.aj" options="-1.5 -Xlint:error"> >+ </compile> >+ <run class="B2"> >+ <stdout> >+ <line text="@anInterface()"/> >+ <line text="========"/> >+ <line text="@anInterface()"/> >+ <line text="========"/> >+ </stdout> >+ </run> >+ </ajc-test> >+ >+ <ajc-test dir="bugs150/pr98901" title="public ITD field with no annotation that has declare @field annotation on it"> >+ <compile files="Case3.aj" options="-1.5 -Xlint:error"> >+ </compile> >+ <run class="B3"> >+ <stdout> >+ <line text="@anInterface()"/> >+ </stdout> >+ </run> >+ </ajc-test> >+ >+ <ajc-test dir="bugs150/pr98901" title="public ITD method with annotation on it which is made onto an interface"> >+ <compile files="Case4.aj" options="-1.5 -Xlint:error"> >+ </compile> >+ <run class="B4"> >+ <stdout> >+ <line text="@anInterface()"/> >+ </stdout> >+ </run> >+ </ajc-test> >+ >+ <ajc-test dir="bugs150/pr98901" title="public abstract ITD method with annotations on it"> >+ <compile files="Case5.aj" options="-1.5 -Xlint:error"> >+ </compile> >+ <run class="B5"> >+ <stdout> >+ <line text="@anInterface()"/> >+ </stdout> >+ </run> >+ </ajc-test> >+ > </suite> >\ No newline at end of file >Index: bugs150/pr98901/Case1.aj >=================================================================== >RCS file: bugs150/pr98901/Case1.aj >diff -N bugs150/pr98901/Case1.aj >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ bugs150/pr98901/Case1.aj 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,29 @@ >+// "public ITD method with no annotation that has declare @method annotation on it" >+ >+import java.lang.annotation.*; >+import java.lang.reflect.Method; >+ >+@Retention(RetentionPolicy.RUNTIME) >+@interface anInterface{} >+ >+aspect B1 { >+ public void B1.a(){} >+ public void B1.b(){} >+ declare @method : void B1.b(..) : @anInterface; >+ >+ before(anInterface a): execution(void B1.a(..)) && @annotation(a) {} // not applied >+ before(anInterface a): execution(void B1.b(..)) && @annotation(a) {} // applied >+ >+ public static void main(String [] args){ >+ Class B1o = B1.class; >+ try { >+ Method bo = B1o.getDeclaredMethod("b", new Class [0]); >+ Annotation [] boAnns = bo.getDeclaredAnnotations(); >+ for (int i = 0;i < boAnns.length;i++){ >+ System.out.println(boAnns[i]); >+ } >+ } catch (Exception e){ >+ System.out.println("exceptional!"); >+ } >+ } >+} >Index: bugs150/pr98901/Case2.aj >=================================================================== >RCS file: bugs150/pr98901/Case2.aj >diff -N bugs150/pr98901/Case2.aj >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ bugs150/pr98901/Case2.aj 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,35 @@ >+// "public ITD field with annotation on it" >+ >+import java.lang.annotation.*; >+import java.lang.reflect.Field; >+ >+@Retention(RetentionPolicy.RUNTIME) >+@interface anInterface{} >+ >+aspect B2 { >+ @anInterface >+ public int a; // local >+ >+ @anInterface >+ public int B2.b; // inter-type >+ >+ public static void main(String [] args){ >+ Class B2o = B2.class; // shurely Aspect c = B1.aspect?? >+ try { >+ Field ao = B2o.getDeclaredField("a"); >+ Annotation [] aoAnns = ao.getDeclaredAnnotations(); >+ for (int i = 0;i < aoAnns.length;i++){ >+ System.out.println(aoAnns[i]); >+ } >+ System.out.println("========"); >+ Field bo = B2o.getDeclaredField("b"); >+ Annotation [] boAnns = bo.getDeclaredAnnotations(); >+ for (int i = 0;i < boAnns.length;i++){ >+ System.out.println(boAnns[i]); >+ } >+ System.out.println("========"); >+ } catch (Exception e){ >+ System.out.println("exceptional!"); >+ } >+ } >+} >Index: bugs150/pr98901/Case3.aj >=================================================================== >RCS file: bugs150/pr98901/Case3.aj >diff -N bugs150/pr98901/Case3.aj >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ bugs150/pr98901/Case3.aj 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,26 @@ >+// "public ITD field with no annotation that has declare @field annotation on it" >+ >+import java.lang.annotation.*; >+import java.lang.reflect.Field; >+ >+@Retention(RetentionPolicy.RUNTIME) >+@interface anInterface{} >+ >+aspect B3 { >+ >+ public int B3.b; // inter-type >+ declare @field : public int B3.b : @anInterface; >+ >+ public static void main(String [] args){ >+ Class B3o = B3.class; // shurely Aspect c = B1.aspect?? >+ try { >+ Field bo = B3o.getDeclaredField("b"); >+ Annotation [] boAnns = bo.getDeclaredAnnotations(); >+ for (int i = 0;i < boAnns.length;i++){ >+ System.out.println(boAnns[i]); >+ } >+ } catch (Exception e){ >+ System.out.println("exceptional!"); >+ } >+ } >+} >Index: bugs150/pr98901/Case4.aj >=================================================================== >RCS file: bugs150/pr98901/Case4.aj >diff -N bugs150/pr98901/Case4.aj >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ bugs150/pr98901/Case4.aj 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+// "public ITD method with annotation on it which is made onto an interface" >+ >+import java.lang.annotation.*; >+import java.lang.reflect.Method; >+ >+@Retention(RetentionPolicy.RUNTIME) >+@interface anInterface{} >+ >+interface A4{} >+ >+aspect B4 { >+ >+ @anInterface >+ public void A4.a() {} >+ >+ public static void main(String [] args){ >+ Class A4o = A4.class; // shurely Interface c = B1.interface?? >+ try { >+ Method ao = A4o.getDeclaredMethod("a", new Class [0]); >+ Annotation [] aoAnns = ao.getDeclaredAnnotations(); >+ for (int i = 0;i < aoAnns.length;i++){ >+ System.out.println(aoAnns[i]); >+ } >+ } catch (Exception e){ >+ System.out.println("exceptional!"); >+ } >+ } >+} >Index: bugs150/pr98901/Case5.aj >=================================================================== >RCS file: bugs150/pr98901/Case5.aj >diff -N bugs150/pr98901/Case5.aj >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ bugs150/pr98901/Case5.aj 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+// "public abstract ITD method with annotations on it" >+ >+import java.lang.annotation.*; >+import java.lang.reflect.Method; >+ >+@Retention(RetentionPolicy.RUNTIME) >+@interface anInterface{} >+ >+abstract class A5{} >+ >+aspect B5 { >+ >+ @anInterface >+ public abstract void A5.a(); >+ >+ public static void main(String [] args){ >+ Class A5o = A5.class; >+ try { >+ Method ao = A5o.getDeclaredMethod("a", new Class [0]); >+ Annotation [] aoAnns = ao.getDeclaredAnnotations(); >+ for (int i = 0;i < aoAnns.length;i++){ >+ System.out.println(aoAnns[i]); >+ } >+ } catch (Exception e){ >+ System.out.println("exceptional!"); >+ } >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 98901
:
22786
|
23871
|
24121
|
24382
|
25399
|
25739
|
36976