Skip to content

Documentation enhancement for Custom Pointcuts #14036

Closed
@ch-beck

Description

@ch-beck

In current the documentation for Matching Methods with Custom Pointcuts there are examples of custom pointcut in Java/Kotlin and XML which should be equivalent.

While the XML variant works and is currently used by us, the Java example doesn't work.

As far as I understand, the pointcut pattern in the example is an AspectJ pointcut but the class used is JdkRegexpMethodPointcut. Trying to run the example as is results in

java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 10
execution(* com.mycompany.*Service.*(..))
          ^

Swapping the JdkRegexpMethodPointcut for AspectJExpressionPointcut (and replacing pattern.setPattern() with pattern.setExpression()) results in a working app with expected behaviour.

The example should therefore probably either use AspectJExpressionPointcut (with pattern.setExpression()) or a different pattern (which would make the XML example not equivalent anymore).

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplesstatus: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions