aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/generics/pointcuts/StaticInitializationWithParameterizedTypesMatching.aj
blob: b1c4e9c794a79988eb857f9373da605d54cb3054 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public aspect StaticInitializationWithParameterizedTypesMatching {
	
	pointcut allowedStaticInit() : staticinitialization(GenericInterface<Double>+);
	
	pointcut allowedStaticInitClass() : staticinitialization(GenericImplementingClass<Double>+);
	
	// matches ConcreteImplementingClass
	// matches ConcreteExtendingClass
	declare warning : allowedStaticInit() : "clinit(GenericInterface<Double>+)";
	
	// matches ConcreteExtendingClass
	declare warning : allowedStaticInitClass() : "clinit(GenericImplementingClass<Double>+)";
	
	// no matches
	declare warning : staticinitialization(GenericInterface<String>+) :
		"should not match";
	
	// no matches
	declare warning : staticinitialization(GenericInterface<Double,Double>+) :
		"should not match";
}