title: Aspectj @Around pointcut all methods in Java
body: <p>i am writing a simple timer aspect to instrument all the methods in all the packages that belong my project. But, then the return types of various methods in those classes are different and I am getting this following <strong>error</strong>:</p>
  
  <p>It only works for setter but not for getter... </p>
  
  <blockquote>
    <p>Error: applying to joinpoint that doesn't return void</p>
  </blockquote>
  
  <p>and here is my <code>timeraspect</code>...</p>
  
  <pre><code>@Around("execution(* com.myproject..*(..))")
  public void log(ProceedingJoinPoint pjp) throws Throwable{
  
  
      LOG.info("TimerAspect");
      String name = pjp.getSignature().getName();
      Monitor mon = MonitorFactory.start(name);
      pjp.proceed();
      mon.stop();
  
      LOG.info("TimerAspect Mon" + mon);
  
      String printStr = mon.getLabel()+","+mon.getUnits()+","+mon.getLastValue()+","+mon.getHits()+","+mon.getAvg()+","+mon.getTotal()+","+mon.getMin()+","+mon.getMax()+","+mon.getFirstAccess()+","+mon.getLastAccess();
  
      File f = new File("target/stats.csv");
      BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(f, true));
      bufferedWriter.write(printStr);
      bufferedWriter.newLine();
      bufferedWriter.flush();
      bufferedWriter.close();
  
  
  }
  </code></pre>
  
  <p>Any clue to resolve this is greatly appreciated.</p>
  
  <p>Thanks</p>