You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GenericsLost.java 490B

1234567891011121314151617181920212223
  1. import java.util.*;
  2. import java.lang.reflect.*;
  3. aspect Foo {
  4. public List<String> Goo.getStrings() {
  5. return null;
  6. }
  7. }
  8. class Goo {
  9. }
  10. public class GenericsLost {
  11. public static void main(String[]argv) throws Exception {
  12. Method m = Goo.class.getDeclaredMethod("getStrings");
  13. Type t = m.getGenericReturnType();
  14. if (!t.toString().equals("java.util.List<java.lang.String>"))
  15. throw new RuntimeException("Incorrect signature. Signature is "+t);
  16. }
  17. }