title: Pointcut for annotated methods or methods in annotated classes
body: <p>I need <b>a pointcut for methods in classes annotated with @X or methods annotated with @X</b>. I also <b>need the annotation object</b>. If both the class and the method are annotated <b>I prefer to get the method annotation as argument</b>.</p>
  
  <p>I tried the following, which creates an "inconsistent binding" warning. (Why not just set them null?)</p>
  
  <pre><code>@Around("@annotation(methodLevelX) || @within(classLevelX)")
  public Object advise(ProceedingJoinPoint pjp, X methodLevelX, X classLevelX)
  </code></pre>
  
  <p>The following creates a "ambiguous binding of parameter(s) x across '||' in pointcut" warning. (Which does not necessarily make sense in my opinion: Why not bind the first short circuited evaluation?)</p>
  
  <pre><code>@Around("@annotation(x) || @within(x)")
  public Object advise(ProceedingJoinPoint pjp, X x)
  </code></pre>
  
  <p>Splitting the previous attempt in two naturally results in two method calls if class and method annotations are present.  </p>
  
  <p>I know I could just get the method and class with reflection and my desired annotation with a pointcut like this:</p>
  
  <pre><code>@Around("@annotation(com.package.X) || @within(com.package.X)")
  </code></pre>
  
  <p>But I'd prefer not to.</p>
  
  <p><b>Is there any "one pointcut, one method, one annotation argument", solution for my requirement that does not require reflection?</b></p>