You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #20167 (comment) the use of @RegisterForReflection(targets = String.class, serialization = true) is a bit confusing since it doesn't make clear whether the corresponding class should also be registered for reflection in general (right now it does not).
At the moment it's also not clear how to register a class for both reflection and serialization. Would
As a result this feature request is about providing a cleaner interface (through a new annotation) to the end users for registering classes for reflection, serialization, or both.
Implementation ideas
As proposed by@vsevel it looks like a better approach would be to use a new annotation (instead of parameterizing RegisterForReflection).
Then to register a class for both reflection and serialization one should do the following:
Not sure if it should be a separate issue, but I'd also love it if we could tune the API of @RegisterForReflection to strongly encourage adding a conditional tied to code reachability - perhaps it should be a required attribute of the annotation?
I understand that making it required would make it a lot of work to migrate to the new annotation, but a good compromise would be to have a default conditional which signals "I haven't thought of this yet"; this could be a placeholder, and we could deprecate it already to discourage excessive use, especially discourage in new code.
Description
As discussed in #20167 (comment) the use of
@RegisterForReflection(targets = String.class, serialization = true)
is a bit confusing since it doesn't make clear whether the corresponding class should also be registered for reflection in general (right now it does not).At the moment it's also not clear how to register a class for both reflection and serialization. Would
do the trick in such cases?
As a result this feature request is about providing a cleaner interface (through a new annotation) to the end users for registering classes for reflection, serialization, or both.
Implementation ideas
As proposed by @vsevel it looks like a better approach would be to use a new annotation (instead of parameterizing
RegisterForReflection
).Then to register a class for both reflection and serialization one should do the following:
or
The text was updated successfully, but these errors were encountered: