Skip to content

Allow to bind modifiers using the @Origin annotation. #1865

@jafarre-bi

Description

@jafarre-bi

Hello,
In the plugin I'm developing, I need to use method modifiers within the advice. As a first approach, I bound @Origin Method, but this requires reflectively retrieving the Method every time, or alternatively caching it.
As I only needed the modifiers, I've created a custom binding that allows me to use the @Origin annotation on an int parameter and map the modifiers as a constant.
It boils down to adding a new if condition to the ForOrigin.Factory.make method.
This makes sense as a general-purpose functionality of the annotation. When rendering it into a String, a new flag could be used to render the modifiers as they appear in the code, following the Java order convention.
What do you think?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions