blob: 2cdf76dc6572e6c5d06460c4ec2042450c30ce96 (
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
|
import java.util.*;
import java.lang.reflect.*;
// interface ITD
aspect Foo {
public List<String> IFace.getStrings() {
return null;
}
}
interface IFace {}
class Goo implements IFace {}
public class GenericsLost4 {
public static void main(String[]argv) throws Exception {
Method m = Goo.class.getDeclaredMethod("getStrings");
Type t = m.getGenericReturnType();
if (!t.toString().equals("java.util.List<java.lang.String>"))
throw new RuntimeException("Incorrect signature. Signature is "+t);
m = IFace.class.getDeclaredMethod("getStrings");
t = m.getGenericReturnType();
if (!t.toString().equals("java.util.List<java.lang.String>"))
throw new RuntimeException("Incorrect signature. Signature is "+t);
}
}
|