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.

Driver.java 784B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import org.aspectj.testing.Tester;
  2. import java.util.*;
  3. // PR#307 cflow and object creations
  4. public class Driver {
  5. public static String s = "";
  6. public static void main(String[] args){
  7. new FTPServer();
  8. Tester.checkEqual(s, "-connected-after", "");
  9. }
  10. }
  11. /* PR306 */
  12. class FTPServer {
  13. public FTPServer() {
  14. new FTPConnection().connect();
  15. }
  16. }
  17. class FTPConnection {
  18. public void connect() {
  19. Driver.s += "-connected";
  20. }
  21. }
  22. aspect FooBuilding percflow(serverIdentification(FTPServer)) {
  23. pointcut serverIdentification(FTPServer s) :
  24. target(s) && execution(new(..));
  25. after() returning (Object ret):
  26. target(FTPConnection) && call(* *(..)) {
  27. Driver.s += "-after";
  28. }
  29. }