Skip to content

address annotation style if() pointcut binding restrictions that don't affect code style #120

Closed
@aclement

Description

@aclement

annotation style binding is not great when if() pointcuts are involved. There is a compiler limitation that requires reference pointcuts to always bind variables that are used in if() pointcut support methods. This does not work:

@Aspect class Azpect {
  @Pointcut("this(f) && if()") public static boolean method(Foo f) { return f.isTrue();}
  @Before("method(*) && execution(* *.run(..))") public void beforeAdvice() {}
}

You are forced to bind o in the method beforeAdvice() - code style does not have this restriction. Compiling the above will give something like:

Missing binding for if() pointcut method (method).  Parameter 1 (D d) must be bound - even in reference pointcuts  (compiler limitation)

Metadata

Metadata

Assignees

No one assigned

    Labels

    annotation-styleIssues relating to the annotation style syntaxenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions