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

Collapse All | Expand All

(-)bugs150/PR113447.java (-40 lines)
Removed Link Here
1
public class PR113447 {
2
3
	public static void main(String[] args) {
4
		PR113447 me = new PR113447();
5
		me.method1();
6
		me.method3();
7
	}
8
	
9
	public void method1(){}
10
11
	public void method3(){}
12
}
13
14
aspect Super {
15
16
	// second method doesn't exist
17
	pointcut pc1(PR113447 s) : 
18
		(this(s) && execution(void method1()))
19
		|| (this(s) && execution(void method2()));
20
21
	before(PR113447 s) : pc1(s) {
22
	}
23
	
24
	// second method does exist
25
	pointcut pc2(PR113447 s) : 
26
		(this(s) && execution(void method1()))
27
		|| (this(s) && execution(void method3()));
28
29
	before(PR113447 s) : pc2(s) {
30
	}
31
	
32
	// second method doesn't exist
33
	pointcut pc3(PR113447 s) : 
34
		(args(s) && execution(void method1()))
35
		|| (args(s) && execution(void method2()));
36
37
	before(PR113447 s) : pc3(s) {
38
	}
39
40
}
(-)src/org/aspectj/systemtest/ajc150/Ajc150Tests.java (+20 lines)
Lines 647-652 Link Here
647
	  runTest("no verify error with two this pcds");
647
	  runTest("no verify error with two this pcds");
648
  }
648
  }
649
  
649
  
650
  public void testNoVerifyErrorWithTwoAtThisPCDs_pr113447() {
651
	  runTest("no verify error with two at this pcds");
652
  }
653
  
654
  public void testNoVerifyErrorWithAtWithinPCDs_pr113447() {
655
	  runTest("no verify error with at within pcds");
656
  }
657
  
658
  public void testNoVerifyErrorWithAtWithincodePCDs_pr113447() {
659
	  runTest("no verify error with at withincode pcds");
660
  }
661
  
662
  public void testNoVerifyErrorWithAtAnnotationPCDs_pr113447() {
663
	  runTest("no verify error with at annotation pcds");
664
  }
665
  
666
  public void testNoVerifyErrorWithTwoArgsPCDs_pr113447() {
667
	  runTest("no verify error with two args pcds");
668
  }
669
  
650
  // helper methods.....
670
  // helper methods.....
651
  
671
  
652
  public SyntheticRepository createRepos(File cpentry) {
672
  public SyntheticRepository createRepos(File cpentry) {
(-)src/org/aspectj/systemtest/ajc150/ajc150.xml (-1 / +31 lines)
Lines 761-772 Link Here
761
        </compile>
761
        </compile>
762
    </ajc-test> 
762
    </ajc-test> 
763
763
764
    <ajc-test dir="bugs150" title="no verify error with two this pcds">
764
    <ajc-test dir="bugs150/pr113447" title="no verify error with two this pcds">
765
        <compile files="PR113447.java">
765
        <compile files="PR113447.java">
766
        </compile>
766
        </compile>
767
        <run class="PR113447"/>
767
        <run class="PR113447"/>
768
    </ajc-test> 
768
    </ajc-test> 
769
769
770
	<ajc-test dir="bugs150/pr113447" title="no verify error with two at this pcds">
771
        <compile files="PR113447a.java" options="-1.5">
772
        </compile>
773
        <run class="PR113447a"/>
774
    </ajc-test>
775
776
	<ajc-test dir="bugs150/pr113447" title="no verify error with at within pcds">
777
        <compile files="PR113447b.java" options="-1.5">
778
        </compile>
779
        <run class="PR113447b"/>
780
    </ajc-test>
781
782
	<ajc-test dir="bugs150/pr113447" title="no verify error with at withincode pcds">
783
        <compile files="PR113447c.java" options="-1.5">
784
        </compile>
785
        <run class="PR113447c"/>
786
    </ajc-test>
787
788
	<ajc-test dir="bugs150/pr113447" title="no verify error with at annotation pcds">
789
        <compile files="PR113447d.java" options="-1.5">
790
        </compile>
791
        <run class="PR113447d"/>
792
    </ajc-test>
793
794
	<ajc-test dir="bugs150/pr113447" title="no verify error with two args pcds">
795
        <compile files="PR113447e.java" options="-1.5">
796
        </compile>
797
        <run class="PR113447e"/>
798
    </ajc-test>
799
770
    <!-- ============================================================================ -->
800
    <!-- ============================================================================ -->
771
    <!-- ============================================================================ -->
801
    <!-- ============================================================================ -->
772
    
802
    
(-)bugs150/pr113447/PR113447.java (+40 lines)
Added Link Here
1
public class PR113447 {
2
3
	public static void main(String[] args) {
4
		PR113447 me = new PR113447();
5
		me.method1();
6
		me.method3();
7
	}
8
	
9
	public void method1(){}
10
11
	public void method3(){}
12
}
13
14
aspect Super {
15
16
	// second method doesn't exist
17
	pointcut pc1(PR113447 s) : 
18
		(this(s) && execution(void method1()))
19
		|| (this(s) && execution(void method2()));
20
21
	before(PR113447 s) : pc1(s) {
22
	}
23
	
24
	// second method does exist
25
	pointcut pc2(PR113447 s) : 
26
		(this(s) && execution(void method1()))
27
		|| (this(s) && execution(void method3()));
28
29
	before(PR113447 s) : pc2(s) {
30
	}
31
	
32
	// second method doesn't exist
33
	pointcut pc3(PR113447 s) : 
34
		(args(s) && execution(void method1()))
35
		|| (args(s) && execution(void method2()));
36
37
	before(PR113447 s) : pc3(s) {
38
	}
39
40
}
(-)bugs150/pr113447/PR113447a.java (+65 lines)
Added Link Here
1
import java.lang.annotation.Retention;
2
import java.lang.annotation.RetentionPolicy;
3
4
@Retention(RetentionPolicy.RUNTIME)
5
@interface Annotation{};
6
7
@Annotation
8
public class PR113447a {
9
10
	public static void main(String[] args) {
11
		PR113447a me = new PR113447a();
12
		me.method1();
13
		me.method3();
14
		me.method4(2);
15
	}
16
	
17
	public void method1(){}
18
19
	public void method3(){}
20
	
21
	public void method4(int i){}
22
	public void method5(int i){}
23
}
24
25
aspect Super {
26
27
	// second method doesn't exist
28
	pointcut pc1(Annotation a) : 
29
		(@this(a) && execution(void method1()))
30
		|| (@this(a) && execution(void method2()));
31
32
	before(Annotation a) : pc1(a) {}
33
	
34
	// second method does exist
35
	pointcut pc2(Annotation a) : 
36
		(@this(a) && execution(void method1()))
37
		|| (@this(a) && execution(void method3()));
38
39
	before(Annotation a) : pc2(a) {}
40
	
41
	// second method doesn't exist
42
	pointcut pc3(Annotation a) : 
43
		(@target(a) && call(void method1()))
44
		|| (@target(a) && call(void method2()));
45
46
	before(Annotation a) : pc3(a) {
47
	}
48
	
49
	// second method does exist
50
	pointcut pc4(Annotation a) : 
51
		(@target(a) && call(void method1()))
52
		|| (@target(a) && call(void method3()));
53
54
	before(Annotation a) : pc4(a) {
55
	}
56
	
57
	// @this equivalent of BaseTests.test024 which was affected by
58
	// the fix for the non annotation version
59
	pointcut p(Annotation a) : 
60
		@target(a) && (call(void method4(int)) 
61
				|| call(void method5(int)));
62
63
	before(Annotation a) : p(a) {}
64
	after(Annotation a): p(a) {}
65
}
(-)bugs150/pr113447/PR113447b.java (+27 lines)
Added Link Here
1
import java.lang.annotation.Retention;
2
import java.lang.annotation.RetentionPolicy;
3
4
@Retention(RetentionPolicy.RUNTIME)
5
@interface Annotation{};
6
7
@Annotation
8
public class PR113447b {
9
10
	public static void main(String[] args) {
11
		PR113447b me = new PR113447b();
12
		me.method4(1);
13
	}
14
	
15
	public void method4(int i){}
16
	public void method5(int i){}
17
}
18
19
aspect Super {
20
21
	pointcut p(Annotation a) : 
22
		@within(a) && (call(void method4(int)) 
23
				|| call(void method5(int)));
24
25
	before(Annotation a) : p(a) {}
26
27
}
(-)bugs150/pr113447/PR113447c.java (+27 lines)
Added Link Here
1
import java.lang.annotation.Retention;
2
import java.lang.annotation.RetentionPolicy;
3
4
@Retention(RetentionPolicy.RUNTIME)
5
@interface Annotation{};
6
7
public class PR113447c {
8
9
	@Annotation
10
	public static void main(String[] args) {
11
		PR113447c me = new PR113447c();
12
		me.method4(1);
13
	}
14
15
	public void method4(int i){}
16
	public void method5(int i){}
17
}
18
19
aspect Super {
20
21
	pointcut p(Annotation a) : 
22
		@withincode(a) && (call(void method4(int)) 
23
				|| call(void method5(int)));
24
25
	before(Annotation a) : p(a) {}
26
27
}
(-)bugs150/pr113447/PR113447d.java (+25 lines)
Added Link Here
1
import java.lang.annotation.Retention;
2
import java.lang.annotation.RetentionPolicy;
3
4
@Retention(RetentionPolicy.RUNTIME)
5
@interface Annotation{};
6
7
public class PR113447d {
8
9
	public static void main(String[] args) {
10
		PR113447d me = new PR113447d();
11
		me.method4(1);
12
	}
13
	
14
	@Annotation public void method4(int i){}
15
	@Annotation public void method5(int i){}
16
}
17
18
aspect Super {
19
	
20
	pointcut p(Annotation a) : 
21
		@annotation(a) && (call(void method4(int)) 
22
				|| call(void method5(int)));
23
24
	before(Annotation a) : p(a) {}
25
}
(-)bugs150/pr113447/PR113447e.java (+36 lines)
Added Link Here
1
public class PR113447e {
2
3
	public static void main(String[] args) {
4
		PR113447e me = new PR113447e();
5
		me.method1(1);
6
		me.method3(2);
7
	}
8
	
9
	public void method1(int i){}
10
11
	public void method3(int i){}
12
}
13
14
aspect Super {
15
16
	// second method doesn't exist
17
	pointcut pc1(int i) : 
18
		(args(i) && call(void method1(int)))
19
		|| (args(i) && call(void method2(int)));
20
21
	before(int i) : pc1(i) {}
22
	
23
	// second method does exist
24
	pointcut pc2(int i) : 
25
		(args(i) && call(void method1(int)))
26
		|| (args(i) && call(void method3(int)));
27
28
	before(int i) : pc2(i) {}
29
	
30
	// ensure this still works
31
	pointcut pc3(int i) :
32
		args(i) && (call(void method1(int)) || call(void method2(int)));
33
	
34
	before(int i) : pc3(i) {}
35
	after(int i) : pc3(i) {}
36
}

Return to bug 113447