aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs162/pr238992/Foo.java
blob: d4fe3600dc5191446a441ce5ff28c93d6fbf0e28 (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
import java.lang.annotation.*;
import java.io.*;

@Entity(indexed=false)
public class Foo {
  public static void main(String []argv) {
    Foo f = new Foo();
    Goo g = new Goo();
    if (f instanceof Serializable) {
       throw new RuntimeException("Foo should not implement it");        
    }
    if (!(g instanceof Serializable)) {
       throw new RuntimeException("Goo should implement it");        
    }
    if (new Hoo() instanceof Serializable) {
       throw new RuntimeException("Hoo should not implement it");        
    }
  }
}

@Entity(indexed=true)
class Goo {
}

@Entity // default is false
class Hoo {
}

@Retention(RetentionPolicy.RUNTIME)
@interface Entity {
  boolean indexed() default false;
}

aspect X {
  declare parents: (@Entity(indexed=true) *) implements java.io.Serializable;
}