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

Java 12 and Operator detection #46

Open
despondency opened this issue Apr 21, 2019 · 2 comments
Open

Java 12 and Operator detection #46

despondency opened this issue Apr 21, 2019 · 2 comments

Comments

@despondency
Copy link

It appears that using Java 12, Reflections library does not detect the @operator'ed class and says there are none. Any ideas? Probably Reflections does not support Java 12?

Best,

Mario

@jkremser
Copy link
Member

Mario,
abstract operator uses this Java library for finding all annotated classes. If I recall correctly, the library also has a feature for finding all the sub-classes of a certain class at run-time, and it should be also turned on in the abstract operator . This way one can create a operator in languages that doesn't support java annotations, like JavaScript (example).

Could you please provide a reproducer for this? Were you doing some module optimization with jlink? If I am not mistaken, reflection in some form should be still there in Java 12. However, there were some changes in the recent versions of Java so it is possible that the https://github.com/ronmamo/reflections may not work as expected in the newest Java.

It's possible that in the future, we will migrate to https://github.com/classgraph/classgraph or some other mechanism that actually also works for the native images in Graal VM.

@despondency
Copy link
Author

Jiri,

The reproducing case is, just use openjdk 12 and you will see that the @operator annotation is not getting scanned by the Reflections library, even though the class is extending AbstractOperator and has @operator on it. Looking it through the debugger it just returns 0 as the List size for classes which are subclassing AbstractOperator and are annotated with @operator.

Best,

Mario

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

2 participants