View | Details | Raw Unified | Return to bug 98901 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/aspectj/systemtest/ajc150/ajc150.xml (+262 lines)
Lines 2370-2373 Link Here
2370
   <!--     End of generics tests                                      -->
2370
   <!--     End of generics tests                                      -->
2371
   <!-- ============================================================== -->
2371
   <!-- ============================================================== -->
2372
   
2372
   
2373
   <ajc-test dir="bugs150/pr98901" title="public method with declare @method">
2374
     <compile files="Case01.aj" options="-1.5 -Xlint:error"/>
2375
     <run class="B01">
2376
         <stdout>
2377
           <line text="@anInterface()"/>
2378
         </stdout>
2379
       </run>
2380
   </ajc-test>
2381
   
2382
   <ajc-test dir="bugs150/pr98901" title="public method on the aspect that declares @method on it">
2383
     <compile files="Case02.aj" options="-1.5 -Xlint:error"/>
2384
     <run class="B02">
2385
         <stdout>
2386
           <line text="@anInterface()"/>
2387
         </stdout>
2388
       </run>
2389
   </ajc-test>
2390
   
2391
   <ajc-test dir="bugs150/pr98901" title="public annotated method">
2392
     <compile files="Case03.aj" options="-1.5 -Xlint:error"/>
2393
     <run class="B03">
2394
         <stdout>
2395
           <line text="@anInterface()"/>
2396
         </stdout>
2397
       </run>
2398
   </ajc-test>
2399
   
2400
<ajc-test dir="bugs150/pr98901" title="public ITD method with declare @method">
2401
     <compile files="Case04.aj" options="-1.5 -Xlint:error"/>
2402
     <run class="B04">
2403
         <stdout>
2404
           <line text="@anInterface()"/>
2405
         </stdout>
2406
       </run>
2407
   </ajc-test>
2408
2409
<ajc-test dir="bugs150/pr98901" title="public annotated ITD method">
2410
     <compile files="Case05.aj" options="-1.5 -Xlint:error"/>
2411
     <run class="B05">
2412
         <stdout>
2413
           <line text="@anInterface()"/>
2414
         </stdout>
2415
       </run>
2416
   </ajc-test>
2417
   
2418
<ajc-test dir="bugs150/pr98901" title="public ITD-on-itself method with declare @method">
2419
     <compile files="Case06.aj" options="-1.5 -Xlint:error"/>
2420
     <run class="B06">
2421
         <stdout>
2422
           <line text="@anInterface()"/>
2423
         </stdout>
2424
       </run>
2425
   </ajc-test>
2426
   
2427
<ajc-test dir="bugs150/pr98901" title="public annotated ITD-on-itself method">
2428
     <compile files="Case07.aj" options="-1.5 -Xlint:error"/>
2429
     <run class="B07">
2430
         <stdout>
2431
           <line text="@anInterface()"/>
2432
         </stdout>
2433
       </run>
2434
   </ajc-test>
2435
   
2436
<ajc-test dir="bugs150/pr98901" title="public method on an Interface with declare @method">
2437
     <compile files="Case08.aj" options="-1.5 -Xlint:error"/>
2438
     <run class="B08">
2439
         <stdout>
2440
           <line text="@anInterface()"/>
2441
         </stdout>
2442
       </run>
2443
   </ajc-test>
2444
2445
<ajc-test dir="bugs150/pr98901" title="public annotated method on an Interface">
2446
     <compile files="Case09.aj" options="-1.5 -Xlint:error"/>
2447
     <run class="B09">
2448
         <stdout>
2449
           <line text="@anInterface()"/>
2450
         </stdout>
2451
       </run>
2452
   </ajc-test>
2453
   
2454
<ajc-test dir="bugs150/pr98901" title="public ITD method onto an Interface with declare @method">
2455
     <compile files="Case10.aj" options="-1.5 -Xlint:error"/>
2456
     <run class="B10">
2457
         <stdout>
2458
           <line text="@anInterface()"/>
2459
         </stdout>
2460
       </run>
2461
   </ajc-test>
2462
   
2463
<ajc-test dir="bugs150/pr98901" title="public annotated ITD method onto an Interface">
2464
     <compile files="Case11.aj" options="-1.5 -Xlint:error"/>
2465
     <run class="B11">
2466
         <stdout>
2467
           <line text="@anInterface()"/>
2468
         </stdout>
2469
       </run>
2470
   </ajc-test>
2471
   
2472
<ajc-test dir="bugs150/pr98901" title="public abstract method with declare @method">
2473
     <compile files="Case12.aj" options="-1.5 -Xlint:error"/>
2474
     <run class="B12">
2475
         <stdout>
2476
           <line text="@anInterface()"/>
2477
         </stdout>
2478
       </run>
2479
   </ajc-test>
2480
2481
<ajc-test dir="bugs150/pr98901" title="public abstract method on the aspect that declares @method on it">
2482
     <compile files="Case13.aj" options="-1.5 -Xlint:error"/>
2483
     <run class="B13">
2484
         <stdout>
2485
           <line text="@anInterface()"/>
2486
         </stdout>
2487
       </run>
2488
   </ajc-test>
2489
   
2490
<ajc-test dir="bugs150/pr98901" title="public abstract annotated method">
2491
     <compile files="Case14.aj" options="-1.5 -Xlint:error"/>
2492
     <run class="B14">
2493
         <stdout>
2494
           <line text="@anInterface()"/>
2495
         </stdout>
2496
       </run>
2497
   </ajc-test>
2498
   
2499
<ajc-test dir="bugs150/pr98901" title="public abstract ITD method with declare @method">
2500
     <compile files="Case15.aj" options="-1.5 -Xlint:error"/>
2501
     <run class="B15">
2502
         <stdout>
2503
           <line text="@anInterface()"/>
2504
         </stdout>
2505
       </run>
2506
   </ajc-test>
2507
2508
<ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD method">
2509
     <compile files="Case16.aj" options="-1.5 -Xlint:error"/>
2510
     <run class="B16">
2511
         <stdout>
2512
           <line text="@anInterface()"/>
2513
         </stdout>
2514
       </run>
2515
   </ajc-test>
2516
   
2517
<ajc-test dir="bugs150/pr98901" title="public abstract ITD-on-itself method with declare @method">
2518
     <compile files="Case17.aj" options="-1.5 -Xlint:error"/>
2519
     <run class="B17">
2520
         <stdout>
2521
           <line text="@anInterface()"/>
2522
         </stdout>
2523
       </run>
2524
   </ajc-test>
2525
   
2526
<ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD-on-itself method">
2527
     <compile files="Case18.aj" options="-1.5 -Xlint:error"/>
2528
     <run class="B18">
2529
         <stdout>
2530
           <line text="@anInterface()"/>
2531
         </stdout>
2532
       </run>
2533
   </ajc-test>
2534
   
2535
<ajc-test dir="bugs150/pr98901" title="public abstract method on an Interface with declare @method">
2536
     <compile files="Case19.aj" options="-1.5 -Xlint:error"/>
2537
     <run class="B19">
2538
         <stdout>
2539
           <line text="@anInterface()"/>
2540
         </stdout>
2541
       </run>
2542
   </ajc-test>
2543
2544
<ajc-test dir="bugs150/pr98901" title="public abstract annotated method on an Interface">
2545
     <compile files="Case20.aj" options="-1.5 -Xlint:error"/>
2546
     <run class="B20">
2547
         <stdout>
2548
           <line text="@anInterface()"/>
2549
         </stdout>
2550
       </run>
2551
   </ajc-test>
2552
   
2553
<ajc-test dir="bugs150/pr98901" title="public abstract ITD method onto an Interface with declare @method">
2554
     <compile files="Case21.aj" options="-1.5 -Xlint:error"/>
2555
     <run class="B21">
2556
         <stdout>
2557
           <line text="@anInterface()"/>
2558
         </stdout>
2559
       </run>
2560
   </ajc-test>
2561
   
2562
<ajc-test dir="bugs150/pr98901" title="public abstract annotated ITD method onto an Interface">
2563
     <compile files="Case22.aj" options="-1.5 -Xlint:error"/>
2564
     <run class="B22">
2565
         <stdout>
2566
           <line text="@anInterface()"/>
2567
         </stdout>
2568
       </run>
2569
   </ajc-test>
2570
   
2571
<ajc-test dir="bugs150/pr98901" title="public field with declare @field">
2572
     <compile files="Case23.aj" options="-1.5 -Xlint:error"/>
2573
     <run class="B23">
2574
         <stdout>
2575
           <line text="@anInterface()"/>
2576
         </stdout>
2577
       </run>
2578
   </ajc-test>
2579
  
2580
2581
<ajc-test dir="bugs150/pr98901" title="public field on the aspect that declares @field on it">
2582
     <compile files="Case24.aj" options="-1.5 -Xlint:error"/>
2583
     <run class="B24">
2584
         <stdout>
2585
           <line text="@anInterface()"/>
2586
         </stdout>
2587
       </run>
2588
   </ajc-test>
2589
   
2590
<ajc-test dir="bugs150/pr98901" title="public annotated field">
2591
     <compile files="Case25.aj" options="-1.5 -Xlint:error"/>
2592
     <run class="B25">
2593
         <stdout>
2594
           <line text="@anInterface()"/>
2595
         </stdout>
2596
       </run>
2597
   </ajc-test>
2598
   
2599
<ajc-test dir="bugs150/pr98901" title="public ITD field with declare @field">
2600
     <compile files="Case26.aj" options="-1.5 -Xlint:error"/>
2601
     <run class="B26">
2602
         <stdout>
2603
           <line text="@anInterface()"/>
2604
         </stdout>
2605
       </run>
2606
   </ajc-test>
2607
2608
<ajc-test dir="bugs150/pr98901" title="public annotated ITD field">
2609
     <compile files="Case27.aj" options="-1.5 -Xlint:error"/>
2610
     <run class="B27">
2611
         <stdout>
2612
           <line text="@anInterface()"/>
2613
         </stdout>
2614
       </run>
2615
   </ajc-test>
2616
   
2617
<ajc-test dir="bugs150/pr98901" title="public ITD-on-itself field with declare @field">
2618
     <compile files="Case28.aj" options="-1.5 -Xlint:error"/>
2619
     <run class="B28">
2620
         <stdout>
2621
           <line text="@anInterface()"/>
2622
         </stdout>
2623
       </run>
2624
   </ajc-test>
2625
   
2626
<ajc-test dir="bugs150/pr98901" title="public annotated ITD-on-itself field">
2627
     <compile files="Case29.aj" options="-1.5 -Xlint:error"/>
2628
     <run class="B29">
2629
         <stdout>
2630
           <line text="@anInterface()"/>
2631
         </stdout>
2632
       </run>
2633
   </ajc-test>
2634
   
2373
</suite>
2635
</suite>
(-)bugs150/pr98901/Case01.aj (+28 lines)
Added Link Here
1
// "public method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A01{
10
	public void a(){}
11
}
12
13
aspect B01 {
14
	declare @method : void A01.a(..) : @anInterface;
15
	
16
	public static void main(String [] args){
17
		Class c = A01.class;
18
		try {
19
		Method m = c.getDeclaredMethod("a", new Class [0]);
20
		Annotation [] anns = m.getDeclaredAnnotations();
21
		for (int i = 0;i < anns.length;i++){
22
			System.out.println(anns[i]);
23
		}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case02.aj (+25 lines)
Added Link Here
1
//"public method on the aspect that declares @method on it"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B02 {
10
	public void a(){}
11
	declare @method : void B02.a(..) : @anInterface;
12
	
13
	public static void main(String [] args){
14
		Class c = B02.class;
15
		try {
16
		Method m = c.getDeclaredMethod("a", new Class [0]);
17
		Annotation [] anns = m.getDeclaredAnnotations();
18
		for (int i = 0;i < anns.length;i++){
19
			System.out.println(anns[i]);
20
		}
21
		} catch (Exception e){
22
			System.out.println("exceptional!");
23
		}
24
	}
25
}
(-)bugs150/pr98901/Case03.aj (+28 lines)
Added Link Here
1
//"public annotated method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A03{
10
	@anInterface
11
	public void a(){}
12
}
13
14
aspect B03 {
15
	
16
	public static void main(String [] args){
17
		Class c = A03.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case04.aj (+29 lines)
Added Link Here
1
// "public ITD method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A04{
10
}
11
12
aspect B04 {
13
	
14
	public void A04.a(){}
15
	declare @method : void A04.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A04.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case05.aj (+29 lines)
Added Link Here
1
// "public annotated ITD method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A05{
10
}
11
12
aspect B05 {
13
	
14
	@anInterface
15
	public void A05.a(){}
16
	
17
	public static void main(String [] args){
18
		Class c = A05.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case06.aj (+26 lines)
Added Link Here
1
// "public ITD-on-itself method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B06 {
10
	
11
	public void B06.a(){}
12
	declare @method : void B06.a(..) : @anInterface;
13
	
14
	public static void main(String [] args){
15
		Class c = B06.class;
16
		try {
17
			Method m = c.getDeclaredMethod("a", new Class [0]);
18
			Annotation [] anns = m.getDeclaredAnnotations();
19
			for (int i = 0;i < anns.length;i++){
20
				System.out.println(anns[i]);
21
			}
22
		} catch (Exception e){
23
			System.out.println("exceptional!");
24
		}
25
	}
26
}
(-)bugs150/pr98901/Case07.aj (+26 lines)
Added Link Here
1
//"public annotated ITD-on-itself method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B07 {
10
	
11
	@anInterface
12
	public void B07.a(){}
13
	
14
	public static void main(String [] args){
15
		Class c = B07.class;
16
		try {
17
			Method m = c.getDeclaredMethod("a", new Class [0]);
18
			Annotation [] anns = m.getDeclaredAnnotations();
19
			for (int i = 0;i < anns.length;i++){
20
				System.out.println(anns[i]);
21
			}
22
		} catch (Exception e){
23
			System.out.println("exceptional!");
24
		}
25
	}
26
}
(-)bugs150/pr98901/Case08.aj (+29 lines)
Added Link Here
1
// "public method on an Interface with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A08{
10
	public void a();
11
}
12
13
aspect B08 {
14
	
15
	declare @method : void A08.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A08.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case09.aj (+28 lines)
Added Link Here
1
// "public annotated method on an Interface"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A09{
10
	@anInterface
11
	public void a();
12
}
13
14
aspect B09 {
15
	
16
	public static void main(String [] args){
17
		Class c = A09.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case10.aj (+29 lines)
Added Link Here
1
// "public ITD method onto an Interface with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A10{
10
}
11
12
aspect B10 {
13
	
14
	public void A10.a(){}
15
	declare @method : void A10.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A10.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case11.aj (+29 lines)
Added Link Here
1
//"public annotated ITD method onto an Interface"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A11{
10
}
11
12
aspect B11 {
13
	
14
	@anInterface
15
	public void A11.a(){}
16
	
17
	public static void main(String [] args){
18
		Class c = A11.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case12.aj (+29 lines)
Added Link Here
1
// "public abstract method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract class A12{
10
	public abstract void a();
11
}
12
13
aspect B12 {
14
	
15
	declare @method : abstract void A12.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A12.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case13.aj (+28 lines)
Added Link Here
1
// "public abstract method on the aspect that declares @method on it"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract aspect A13{
10
	public abstract void a();
11
	declare @method : abstract void A13.a(..) : @anInterface;
12
}
13
14
aspect B13 {
15
	
16
	public static void main(String [] args){
17
		Class c = A13.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case14.aj (+28 lines)
Added Link Here
1
// "public abstract annotated method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract class A14{
10
	@anInterface
11
	public abstract void a();
12
}
13
14
aspect B14 {
15
	
16
	public static void main(String [] args){
17
		Class c = A14.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case15.aj (+29 lines)
Added Link Here
1
// "public abstract ITD method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract class A15{
10
}
11
12
aspect B15 {
13
	
14
	public abstract void A15.a();
15
	declare @method : abstract void A15.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A15.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case16.aj (+29 lines)
Added Link Here
1
// "public abstract annotated ITD method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract class A16{
10
}
11
12
aspect B16 {
13
	
14
	@anInterface
15
	public abstract void A16.a();
16
	
17
	public static void main(String [] args){
18
		Class c = A16.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case17.aj (+28 lines)
Added Link Here
1
// "public abstract ITD-on-itself method with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract aspect A17 {
10
	public abstract void A17.a();
11
	declare @method : abstract void A17.a(..) : @anInterface;
12
}
13
14
aspect B17 {
15
	
16
	public static void main(String [] args){
17
		Class c = A17.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case18.aj (+28 lines)
Added Link Here
1
// "public abstract annotated ITD-on-itself method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
abstract aspect A18 {
10
	@anInterface
11
	public abstract void A18.a();
12
}
13
14
aspect B18 {
15
	
16
	public static void main(String [] args){
17
		Class c = A18.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case19.aj (+29 lines)
Added Link Here
1
//"public abstract method on an Interface with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A19 {
10
	public abstract void a();
11
}
12
13
aspect B19 {
14
	
15
	declare @method : abstract void A19.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A19.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case20.aj (+28 lines)
Added Link Here
1
// "public abstract annotated method on an Interface"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A20 {
10
	@anInterface
11
	public abstract void a();
12
}
13
14
aspect B20 {
15
	
16
	public static void main(String [] args){
17
		Class c = A20.class;
18
		try {
19
			Method m = c.getDeclaredMethod("a", new Class [0]);
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case21.aj (+29 lines)
Added Link Here
1
// "public abstract ITD method onto an Interface with declare @method"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A21 {
10
}
11
12
aspect B21 {
13
	
14
	public abstract void A21.a();
15
	declare @method : abstract void A21.a(..) : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A21.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case22.aj (+29 lines)
Added Link Here
1
// "public abstract annotated ITD method onto an Interface"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Method;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
interface A22 {
10
}
11
12
aspect B22 {
13
	
14
	@anInterface
15
	public abstract void A22.a();
16
	
17
	public static void main(String [] args){
18
		Class c = A22.class;
19
		try {
20
			Method m = c.getDeclaredMethod("a", new Class [0]);
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case23.aj (+29 lines)
Added Link Here
1
// "public field with declare @field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A23 {
10
	public int a;
11
}
12
13
aspect B23 {
14
	
15
	declare @field : int A23.a : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A23.class;
19
		try {
20
			Field m = c.getDeclaredField("a");
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case24.aj (+26 lines)
Added Link Here
1
// "public field on the aspect that declares @field on it"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B24 {
10
	
11
	public int a;
12
	declare @field : int B24.a : @anInterface;
13
	
14
	public static void main(String [] args){
15
		Class c = B24.class;
16
		try {
17
			Field m = c.getDeclaredField("a");
18
			Annotation [] anns = m.getDeclaredAnnotations();
19
			for (int i = 0;i < anns.length;i++){
20
				System.out.println(anns[i]);
21
			}
22
		} catch (Exception e){
23
			System.out.println("exceptional!");
24
		}
25
	}
26
}
(-)bugs150/pr98901/Case25.aj (+28 lines)
Added Link Here
1
// "public annotated field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A25{
10
	@anInterface
11
	public int a;
12
}
13
14
aspect B25 {
15
	
16
	public static void main(String [] args){
17
		Class c = A25.class;
18
		try {
19
			Field m = c.getDeclaredField("a");
20
			Annotation [] anns = m.getDeclaredAnnotations();
21
			for (int i = 0;i < anns.length;i++){
22
				System.out.println(anns[i]);
23
			}
24
		} catch (Exception e){
25
			System.out.println("exceptional!");
26
		}
27
	}
28
}
(-)bugs150/pr98901/Case26.aj (+29 lines)
Added Link Here
1
// "public ITD field with declare @field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A26{
10
}
11
12
aspect B26 {
13
	
14
	public int A26.a;
15
	declare @field : int A26.a : @anInterface;
16
	
17
	public static void main(String [] args){
18
		Class c = A26.class;
19
		try {
20
			Field m = c.getDeclaredField("a");
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case27.aj (+29 lines)
Added Link Here
1
// "public annotated ITD field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
class A27{
10
}
11
12
aspect B27 {
13
	
14
	@anInterface
15
	public int A27.a;
16
	
17
	public static void main(String [] args){
18
		Class c = A27.class;
19
		try {
20
			Field m = c.getDeclaredField("a");
21
			Annotation [] anns = m.getDeclaredAnnotations();
22
			for (int i = 0;i < anns.length;i++){
23
				System.out.println(anns[i]);
24
			}
25
		} catch (Exception e){
26
			System.out.println("exceptional!");
27
		}
28
	}
29
}
(-)bugs150/pr98901/Case28.aj (+26 lines)
Added Link Here
1
// "public ITD-on-itself field with declare @field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B28 {
10
	
11
	public int B28.a;
12
	declare @field : int B28.a : @anInterface;
13
	
14
	public static void main(String [] args){
15
		Class c = B28.class;
16
		try {
17
			Field m = c.getDeclaredField("a");
18
			Annotation [] anns = m.getDeclaredAnnotations();
19
			for (int i = 0;i < anns.length;i++){
20
				System.out.println(anns[i]);
21
			}
22
		} catch (Exception e){
23
			System.out.println("exceptional!");
24
		}
25
	}
26
}
(-)bugs150/pr98901/Case29.aj (+26 lines)
Added Link Here
1
// "public annotated ITD-on-itself field"
2
3
import java.lang.annotation.*;
4
import java.lang.reflect.Field;
5
6
@Retention(RetentionPolicy.RUNTIME)
7
@interface anInterface{}
8
9
aspect B29 {
10
	
11
	@anInterface
12
	public int B29.a;
13
	
14
	public static void main(String [] args){
15
		Class c = B29.class;
16
		try {
17
			Field m = c.getDeclaredField("a");
18
			Annotation [] anns = m.getDeclaredAnnotations();
19
			for (int i = 0;i < anns.length;i++){
20
				System.out.println(anns[i]);
21
			}
22
		} catch (Exception e){
23
			System.out.println("exceptional!");
24
		}
25
	}
26
}
(-)src/org/aspectj/systemtest/ajc150/RuntimeAnnotations.java (+126 lines)
Added Link Here
1
package org.aspectj.systemtest.ajc150;
2
3
import java.io.File;
4
5
import junit.framework.Test;
6
7
import org.aspectj.testing.XMLBasedAjcTestCase;
8
9
10
/**
11
 *  Checking that runtime visible annotations are visible at runtime (they get into the class file)
12
 */
13
public class RuntimeAnnotations extends XMLBasedAjcTestCase {
14
15
	  public static Test suite() {
16
	    return XMLBasedAjcTestCase.loadSuite(RuntimeAnnotations.class);
17
	  }
18
19
	  protected File getSpecFile() {
20
	    return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
21
	  }
22
  
23
  public void test01(){
24
    runTest("public method with declare @method");
25
  }
26
  
27
  public void test02(){
28
	    runTest("public method on the aspect that declares @method on it");
29
  }
30
  
31
  public void test03(){
32
	    runTest("public annotated method");
33
  }
34
  
35
  public void test04(){
36
	    runTest("public ITD method with declare @method");
37
}
38
  
39
  public void test05(){
40
	    runTest("public annotated ITD method");
41
}
42
  public void test06(){
43
	    runTest("public ITD-on-itself method with declare @method");
44
}
45
  public void test07(){
46
	    runTest("public annotated ITD-on-itself method");
47
}
48
  public void test08(){
49
	    runTest("public method on an Interface with declare @method");
50
}
51
52
  public void test09(){
53
	    runTest("public annotated method on an Interface");
54
}
55
  
56
  public void test10(){
57
	    runTest("public ITD method onto an Interface with declare @method");
58
}
59
  public void test11(){
60
	    runTest("public annotated ITD method onto an Interface");
61
}
62
  
63
  public void test12(){
64
	    runTest("public abstract method with declare @method");
65
}
66
67
  public void test13(){
68
	    runTest("public abstract method on the aspect that declares @method on it");
69
}
70
  
71
  public void test14(){
72
	    runTest("public abstract annotated method");
73
}
74
  
75
  public void test15(){
76
	    runTest("public abstract ITD method with declare @method");
77
}
78
79
  public void test16(){
80
	    runTest("public abstract annotated ITD method");
81
}
82
  
83
  public void test17(){
84
	    runTest("public abstract ITD-on-itself method with declare @method");
85
}
86
  public void test18(){
87
	    runTest("public abstract annotated ITD-on-itself method");
88
}
89
  public void test19(){
90
	    runTest("public abstract method on an Interface with declare @method");
91
}
92
93
  public void test20(){
94
	    runTest("public abstract annotated method on an Interface");
95
}
96
  public void test21(){
97
	    runTest("public abstract ITD method onto an Interface with declare @method");
98
}
99
  public void test22(){
100
	    runTest("public abstract annotated ITD method onto an Interface");
101
}
102
  public void test23(){
103
	    runTest("public field with declare @field");
104
}
105
106
  public void test24(){
107
	    runTest("public field on the aspect that declares @field on it");
108
}
109
  public void test25(){
110
	    runTest("public annotated field");
111
}
112
  public void test26(){
113
	    runTest("public ITD field with declare @field");
114
}
115
116
  public void test27(){
117
	    runTest("public annotated ITD field");
118
}
119
  public void test28(){
120
	    runTest("public ITD-on-itself field with declare @field");
121
}
122
  public void test29(){
123
	    runTest("public annotated ITD-on-itself field");
124
}
125
126
}

Return to bug 98901