CSC 123 Nightmare Exam You haven't been paying much attention to the programming languages class. In fact, you forgot that the exam was TODAY! You have been given the following problem: 1. Assume you have: class A { void f(int x) {...} } class B { void g() { A a = new A(); a.f(1); } } The professor then says: "write an aspect with an advice that captures the both the instance of of A and the instance of B involved in a call to A.f(int) from within B.g(). Print a message around the call so as to trace it." After fighting off a panic attack you were able to muster the following: void around(A a, B b, int x) : ?? (sorry prof, my head hurts and I forgot!) { System.out.println("f is being called on object "+a+ " from object "+b); System.out.println("with argument "+x); proceed(a,b,x); } You know it's not correct, but hopefully with some further thought you can figure out how to write the appropriate pointcut expression for the advice instead of the pathetic excuse you have now ... 2. Just when you thought you were safe, here comes another question: With respect to the visitor pattern, assume that e1, e2 and e3 are the visitee classes. Write the INTERFACE for the visitor class (methods should return object). 3. You finally wake up and realize that it was only a nightmare. The real exam is a week from today. But you better start studying!