aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/ParentsAndPointcuts.java
blob: 522c29ea577c5ba0a7adcfc0190de6a7a7dee2d6 (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
33
34
35
36
37
38
39
40
41
42
43
44
import org.aspectj.testing.Tester;

public class ParentsAndPointcuts {
    public static void main(String[] args) {
        ContainerDescriptor d = new ContainerDescriptor();
        Tester.check(d instanceof AbstractCaching.Key, "instanceof");
    }
}

aspect AspectBug extends AbstractCaching
perthis(execution(ContainerLoader+.new(..)))
{
    declare parents: ContainerDescriptor implements AbstractCaching.Key;

    protected pointcut loadExecutions( Key key ):
        ContainerLoader.containerLoads( *, key );
}

abstract aspect AbstractCaching  {
    interface Key {}
    protected abstract pointcut loadExecutions(Key key);
}

class Key {
}

class ContainerDescriptor {
}

class ActiveContainer {
}

class ContainerLoader {
    public ActiveContainer createContainer(ContainerDescriptor c) {
        return null;
    }

    public pointcut containerLoads(ContainerLoader loader,
                                   
ContainerDescriptor containerDesc ):
        this(loader) && args(containerDesc)
        && execution(ActiveContainer ContainerLoader.createContainer
(ContainerDescriptor));
}