-
Notifications
You must be signed in to change notification settings - Fork 58
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
Limitations reflection apis #486
Comments
My bet is the libGDX JSON unmarshaller depends a lot on Reflection API. So we either have to support the full reflection API, replace the unmarshaller, or provide a custom implementation replacing ClassReflection and ArrayReflection on a per project basis, with hard coded classes etc. Maybe this can be done by a code generator. |
Good news! I've merged the first implementation of reflection API support for the Bytecoder JavaScript backend. Please take a look at https://github.com/mirkosertic/Bytecoder/blob/master/core/src/test/java/de/mirkosertic/bytecoder/core/ReflectionTest.java to see the supported APIs and usecases. |
@mirkosertic Great! Thanks a lot! If I want to run the
would it be solved if we use java 14/15? |
I am using OpenJDK8 here, IntelliJ as IDE. Basically rebuild the project and run the ReflectionTest class should do the trick. |
Hi Mirko, thanks for the work you've done! Really huge amount 👍 We have tried it out in our branch, see: https://github.com/squins/Bytecoder/tree/issue-research Somehow the ReflectionTest is passing, but in our Main class it is not working. Maybe we have something wrongly configured in bytecoder-maven-plugin in the pom.xml? |
Hey! I investigated your example, and I see the problem! The ATO compiler does currently only include fields in the reflection field list which are statically referenced somewhere in the scanned dependency tree of linked classes. Because "staticField" is only referenced by reflection, and not by explicit JVM bytecode instructions, it is not included in the list of linked fields, and hence not included into the generated reflection metadata. |
I've pushed some fixes to the master branch. Would you please rebase your branch and give it a try? Also, please add the reflection configuration file
|
Related to #344
We are currently working on further implementing LibGDX in our backend. LibGdx uses reflection, arrays and generics together.
We ran into some problems about missing methods, but we could implement them by ourselves. Refers to commit: squins@464f287
A issue research branch is available where we researched this: https://github.com/squins/Bytecoder/tree/libgdx-reflection-requirements
We encountered some missing methods and collected them in a main class.
How hard would it be to implement them?
We have some questions about TClass:
@EmulatedByRuntime
used withgetName
, does this have to do with the AOT compiler?@EmulatedByRuntime
not used forgetComponentName
?Could you document Bytecoder annotations, for example
@EmulatedByRuntime
, to understand how to adapt with Bytecoder?The text was updated successfully, but these errors were encountered: