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

@CalledFromNative annotation #45

Open
amaembo opened this issue Apr 23, 2021 · 2 comments
Open

@CalledFromNative annotation #45

amaembo opened this issue Apr 23, 2021 · 2 comments

Comments

@amaembo
Copy link
Collaborator

amaembo commented Apr 23, 2021

From https://youtrack.jetbrains.com/issue/IDEA-163737:

A very usefull annotation would be a @CalledFromNative that would be used to mark class methods that are meant to be called from native code. This annotation would allow for suppressing of the "method is never used" inspection and would in general help in clarifying the code. This would especially be useful in Android (Studio) projects that mix java and native code.

@realityforge
Copy link

It would also be useful in other contexts such as transpiling to javascript via tools such as J2CL and GWT where java code often exists so it can be called from javascript but may not be invoked from java. Although we mostly just add it to the list of annotations that define entrypoints.

@sixcorners
Copy link

Would it make sense to make an Entrypoint annotation that can be used to annotate other annotations that are put on entrypoints? I'm thinking it would go on annotations like org.kohsuke.MetaInfServices and this CalledFromNative annotation. Or maybe it could be used directly on program elements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants