aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/ajdkExamples/AnnotationsInTypePatterns.aj
blob: 37469f5e7b69d03973e0fea1c7d52e7ba9b0d73b (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
27
28
29
30
31
32
import org.xyz.*; import anns.*;
import org.abc.*;
import java.lang.annotation.Inherited;

public aspect AnnotationsInTypePatterns {
	
	declare warning : staticinitialization(@Immutable *) : "(@Immutable *)";
	
	declare warning : staticinitialization(!@Immutable *) : "(!@Immutable *)";
	
	declare warning : staticinitialization(@Immutable (org.xyz.* || org.abc.*)) : "@Immutable (org.xyz.* || org.abc.*)";

	declare warning : staticinitialization((@Immutable Foo+) || Goo) : "((@Immutable Foo+) || Goo)";

	declare warning : staticinitialization(@(Immutable || NonPersistent) org.xyz..*) : "@(Immutable || NonPersistent) org.xyz..*";

	declare warning : staticinitialization(@Immutable @NonPersistent org.xyz..*) : "@Immutable @NonPersistent org.xyz..*";

	declare warning : staticinitialization(@(@Inherited *) org.xyz..*) : "@(@Inherited *) org.xyz..*";
}

@Immutable
class A {}

class B {}

class Goo {}

class Foo {}

@Immutable
class SubFoo extends Foo {}