title: AspectJ Around Advice
body: <p>I'm writing my master thesis and the title is "Aspect-oriented software development". I have to do a simple project in AspectJ so I set up Eclipse with AspectJ. </p>
  
  <p>I'm having trouble understanding the AROUND advice. I created 3 files: </p>
  
  <p>1) message_out . java</p>
  
  <p>2) message_test . java</p>
  
  <p>3) simple_aspect . aj</p>
  
  <p>In the simple_aspect file: </p>
  
  <p>1) BEFORE and AFTER advice are working as (I think) expected - so, I "commented" them out. </p>
  
  <p>2) The around advice works only for MESSAGE_ONE() method. </p>
  
  <p>My questions are: </p>
  
  <p>1) Can anyone please explain me (from simple_aspect file) the logic behind naming the parameters in the around advice (WHYTHIS, WHYTHAT)?? </p>
  
  <p>2) How to make the aspect accept and change TWO arugments (messages) from MESSAGE_TWO() method. </p>
  
  <p>Thanks :)</p>
  
  <p>message_out.java: </p>
  
  <pre><code>package mypackage;
  public class message_out {
      public static void message_one(String message) {
          System.out.println(message);
      }
      public static void message_two(String message1, String message2) {
          System.out.println(message1 + ", " + message2);
      }
  }
  </code></pre>
  
  <p>message_test.java: </p>
  
  <pre><code>package mypackage;
  public class message_test {
      public static void main(String[] args) {
          message_out.message_one("AAAAA");
          message_out.message_two("BBBBB", "CCCCCC");
      }
  }
  </code></pre>
  
  <p>simple_aspect.aj: </p>
  
  <pre><code>package mypackage;
  public aspect simple_aspect {
      /*pointcut message_before() : call (* message_out.message_one(..));
      before() : message_before() {
          System.out.println("BEFORE");
      }
  
      pointcut message_after() : call (* message_out.message_one(..));
      after() : message_after() {
          System.out.println("AFTER");
      }*/
  
      pointcut message_around(String WHYTHIS) 
      : call(* message_out.message_one(String)) &amp;&amp; args (WHYTHIS); 
      void around (String WHYTHAT) : message_around(WHYTHAT) {
          WHYTHAT = "CHANGED";
          proceed (WHYTHAT);
      }
  }
  </code></pre>