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.

PR298388.java 716B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import org.aspectj.lang.annotation.Aspect;
  2. import org.aspectj.lang.annotation.DeclareMixin;
  3. @Aspect
  4. public class PR298388 {
  5. @DeclareMixin("Thing2")
  6. public static <T> Thing<T> createThingImplementation() {
  7. return new ThingImpl<T>();
  8. }
  9. public static void main(String[] args) {
  10. Thing<String> ts = (Thing<String>) new Thing2<String>();
  11. ts.wibble();
  12. ts.wibble("abc");
  13. String s = ts.wibbleBack("wobble");
  14. System.out.println("done");
  15. }
  16. }
  17. class Thing2<X> {
  18. }
  19. interface Thing<X> {
  20. void wibble();
  21. void wibble(X x);
  22. X wibbleBack(X x);
  23. }
  24. class ThingImpl<X> implements Thing<X> {
  25. ThingImpl() {
  26. }
  27. public void wibble() {
  28. }
  29. public void wibble(X x) {}
  30. public X wibbleBack(X x) { return x;}
  31. }