summaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr115252/AndTypePattern.java
blob: 2f404eeb2ca7ac7517b4f4459d22f814eadb9c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;

@Target({ElementType.METHOD})
@interface MethodAnnotation{}

@Target({ElementType.FIELD})
@interface FieldAnnotation{}

public class AndTypePattern {

	public void method1() {}
	
	@FieldAnnotation
	int field = 1;

}

aspect A {
	
	// should display an xlint message because @FieldAnnotation can't be
	// applied to methods
	pointcut andPointcut() : execution(@(FieldAnnotation && MethodAnnotation) * *(..));
	declare warning : andPointcut() : "andPointcut()";

}