Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation enhancement for Custom Pointcuts #14036

Closed
ch-beck opened this issue Oct 19, 2023 · 4 comments
Closed

Documentation enhancement for Custom Pointcuts #14036

ch-beck opened this issue Oct 19, 2023 · 4 comments
Assignees
Labels
in: docs An issue in Documentation or samples status: duplicate A duplicate of another issue type: enhancement A general enhancement
Milestone

Comments

@ch-beck
Copy link

ch-beck commented Oct 19, 2023

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).

@ch-beck ch-beck added status: waiting-for-triage An issue we've not yet triaged type: enhancement A general enhancement labels Oct 19, 2023
@sjohnr
Copy link
Member

sjohnr commented Oct 19, 2023

Thanks @ch-beck! I think it makes sense to make the XML and Java/Kotlin consistent with AspectJExpressionPointcut (though I haven't personally tried the example as you have). Would you be interested in submitting a PR to adjust the Java/Kotlin examples?

@sjohnr sjohnr added in: docs An issue in Documentation or samples and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 19, 2023
@sjohnr sjohnr self-assigned this Oct 19, 2023
@andreilisa
Copy link

Hello @sjohnr , can I fix it ?

@sjohnr
Copy link
Member

sjohnr commented Nov 30, 2023

@andreilisa Yes, it's yours!

@sjohnr
Copy link
Member

sjohnr commented Nov 30, 2023

Closed via 1d769b5

@sjohnr sjohnr closed this as completed Nov 30, 2023
@sjohnr sjohnr added this to the 6.2.1 milestone Nov 30, 2023
@sjohnr sjohnr added the status: duplicate A duplicate of another issue label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: docs An issue in Documentation or samples status: duplicate A duplicate of another issue type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants